Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Need formula

This topic is 5900 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

Okay here''s what I''m trying to do. I have a simple cube rendered on the screen. The camera is at 0, 3, -30 and the look at point is of course the origin of the cube 0,0,0. I want to rotate the camera around the cube in a circle staying at a constant 30 units away. I can''t remember the formula''s I learned in highschool that dealt with sin cos and angle for figuring this stuff out. That''s what I need right? And searching the internet only frustrated me more as I couldn''t find exactly what I was looking for or the technical jargon was just too much. Please help.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Try changing an angle from 0 to 2*pi.(2*pi or roughly 6.28 is 360 degrees but in radiens). Radiens are the angle unit used by sin and cos.

make your position 30*sin( a ), 3, -30*cos( a )

a would be the changing angle through out the rotation.

with that formula, the viewing position will start(when a=0) at:
0,3,-30 and after rotation(when a=2pi) it''ll be back to that spot.

Share this post

Link to post
Share on other sites

  • 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!