Advertisement

Gimbal lock !

Started by July 01, 2003 07:30 AM
1 comment, last by SirTwist 21 years, 8 months ago
Okay, Iknow what gimbal lock means. At least I thought I knew. But now I found something that seems like another interpretation. 1. You rotate around world x-axis (say 90 degrees), then you wanna rotate around world z-axis. Problem is, that due to our previous rotation the world z-axis is now acually aligned with the y-axis. 2. You rotate around world x-axis (say 90 degrees), then you wanna rotate around world z-axis. Problem is, that due to our previous rotation the world z-axis and the y-axis switched places. Question is in case 1 -> why wasn´t the y-axis rotated 90 degrees as well ? Case 2 is something that doesn´t sound right in a manner. Just don´t know why. Can anybody lighten me up in this ? Most literature on it just states you lose one degree of freedom. That would be so in case 1, which brings me back to the a.m. question . Any help on that ? I am grateful for anything (especially if someone could explain it in a way other than that found on URL´s and literature) Thanks in advance ... Twist
quote:
Original post by SirTwist
Question is in case 1 -> why wasn´t the y-axis rotated 90 degrees as well ?
Case 2 is something that doesn´t sound right in a manner. Just don´t know why.



Of course it was rotated too. Z becomes Y, Y becomes Z and X remains as it is.

What you might want is glPushMatrix(); and glPopMatrix();

[edited by - pleja on July 1, 2003 9:47:59 AM]
Advertisement
I just hacked the math out of MesaGL''s gluLookAt function and adapted it to handle both UVW vectors and Euler angles. Since all the math is handled internally using matrices, we get the best of both worlds: simple 3-angle orientation specification, minimal code, and full 3 degrees of freedom.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

This topic is closed to new replies.

Advertisement