difference between angles (-180 to +180)
Hi. I''m just a hobby game programmer but have recently run into a problem a few weeks ago that I can''t seem to work out. I have a delayed camera that rotates around my character, using the difference between the angles to smoothly rotate the camera around it.
The problem is when I get to 180 and cross over into -180 the simple subtraction formula doesn''t work. Plus, if I have for example, -175 to +175 I don''t get the correct difference, it should be 10.
Can anyone point me in the right direction on how I should be approaching this?
Why use -180 to 180? Why not just go from 0 to 360? If the angle ends up above 360, just subtract 360. If it ends up below zero, just add 360. Seems simple enough.
Of course, the same could be done with your method, but 0 to 360 seems simpler to me.
[edited by - micepick on April 19, 2003 11:10:09 AM]
Of course, the same could be done with your method, but 0 to 360 seems simpler to me.
[edited by - micepick on April 19, 2003 11:10:09 AM]
the +180->-180 angles are only used for first person cameras for other cams use 0->360 as stated above
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement