Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Rotate around a object

Author
Message
Clacker
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 6th Mar 2004 01:56
Ok what I have got is a object that sticks to the ground that I can move forward or back now what I am looking to do is have the camera pointing at the object using the point camera command and be able to rotate clockwise or antilockwise depending on the directional keys around this object I have tryed a few things but they dont seam to be working.
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 6th Mar 2004 02:10
Use Trig:



Obviosuly incrementing or decremention the Angle# will make it rotate clockwise or anti-clockwise. DistanceAway# is how far from the object you want it to be. AnyHeight is just the Y-value you want, can be anything really, all depends on what you want.


"Computers are useless they can only give you answers."
Clacker
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 6th Mar 2004 13:33
What would i need to write to make it rotate around the object

Sorry im not very good at coding
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 6th Mar 2004 13:42
That's basically it. Here's a full example.



Play with the different variables to see how it works. I added in the matrix and 3 cubes so you can see it properly, otherwise the sphere would just look like it's spinning (which it isn't).


"Computers are useless they can only give you answers."
Clacker
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 6th Mar 2004 13:46
Thanks
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 6th Mar 2004 13:48
Anytime.


"Computers are useless they can only give you answers."

Login to post a reply

Server time is: 2025-06-06 17:23:28
Your offset time is: 2025-06-06 17:23:28