Question about EntityPitch

Blitz3D Forums/Blitz3D Programming/Question about EntityPitch

gilk(Posted 2008) [#1]
Hello,

I've noticed that if I try to obtain the pitch of an entity using the EntityPitch command the value I get back is not always correct.

If I rotate the pitch of an entity the value never exceeds -90 to 90. Meanwhile the yaw and roll values can rotate and move within the -180 to 180 range.

On closer inspection, when the entity pitch reaches the end of the -90 to 90 range the yaw and roll values will flip signs or shift 180 degrees to compensate for the pitch value restriction.

My question: Why is the pitch component restricted to the -90 to 90 range as compared to the yaw and roll values which were not?

Thanks in advance for any help,

gilk


Ross C(Posted 2008) [#2]
It's called Gimble Lock. Basically, once you reach -90 or 90, the object flips itself along the X axis, so it's facing the other way. There is maths reason behind this, which i don't understand 100%. If you search for Gimble Lock, you'll probably get a few good articles from Google.


Floyd(Posted 2008) [#3]
Yaw and pitch are like longitude and latitude. Pitch=0 is the equator. Pitch= +90 and -90 are the poles.

Start at the equator, going north. Continue for 135 degrees. You go through the pole and "back down the other side". But you don't say the resulting location has latitude 135. It is 45, and the longitude changes by 180.