Camera (polar co-ordinate ?)
Hi
I just read the
Simple Third-Person Camera Using The Polar Coordinate System
from gamedev
I think its the very few tuts on 3rd person camera viewing technique well written over net
but i am having a few problems
in point 4 he have said in bold letters
"The amount the camera is around the circumference of the imaginary circle going around the subject. In more mathematical terms, q. This explanation is important so I am putting it in bold and explaining it before any other variable. If the polar axis were in the same place as the positive y-axis (90 degrees) than to find this amount you would just add 180 degrees to the amount of the subject’s rotation. However the polar axis is on the positive x-axis. Therefore we must add an additional 90 degrees making the total 270 degrees. Now in OpenGL, you are looking down the negative z-axis. So when you calculate the z-position, you subtract the 270 degrees, rather than adding it."
Please tell me why he is adding 270 degree to the sine and cosince function in detail,after reading his tut i am having a undestanding of what actually those two lines in NeHe lesson 10 were -
X position =X position –sin (angle*PI/180)*0.05f; -equation (1)
Z position = Z position –cos (angle*PI/180)*0.05f;-equation (2)
here we can see X position being subtracted from sin angle,but in the tut since he has added 270 to polar x=rcos(angle) we are getting sin(angle),
which makes perfect sense to me.
But why adding is the portion which i am confused.
Please anyone help me on this matter.
I will be so greatful.
and please tell me whether my idea about the two lines(from NeHe tut) are ok ?
With Regards
Muksitul
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement