Archived

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

Need formula

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