Jump to content
  • Advertisement
Sign in to follow this  
Chumad

Oribt camera - calculate new point?

This topic is 3526 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm creating a star field simulator where the user can click a star then use the mouse to 'orbit' the camera around the star. I can detect when the mouse moves in a certain direction - either up/down/left or right. The part I need help with is calculating the new camera position if the mouse moves in any of those directions. In my mind, to do this, I can imagine a large sphere, with the center of it being the point the camera is orbitting. I just don't know how to calculate the new camera position based on the direction the mouse moved. Any help? Thanks

Share this post


Link to post
Share on other sites
Advertisement
You could treat the cameras position as a rotation, and then use sin and cos to determine the cameras position...

Share this post


Link to post
Share on other sites
Ok, I'm game... how do I do that? I.e, what calcs do I need to use with sin/cos to determine where the camera will be next?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!