Archived

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.

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 on other sites
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 on other sites
Hell yeah thankyou, works great.

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• Forum Statistics

• Total Topics
633000
• Total Posts
3009815
• Who's Online (See full list)

There are no registered users currently online

×