Need formula

Started by
1 comment, last by twysted 21 years, 7 months ago
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.
Advertisement
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.
Hell yeah thankyou, works great.

This topic is closed to new replies.

Advertisement