Rotation with Quaternions : Gembal Lock !

Started by
0 comments, last by yalp 21 years, 12 months ago
Hi, Let me expose my problem : I have to rotate an object. But I have met the ''Gembal Lock'', using Euler angles with glRotatef(). So I read an article (http://www.gamedev.net/reference/articles/article1095.asp) to get rid of this by using quaternions, but my problem is still there ! Here is what I do : get the angle (in Euler axis) to rotate (from mouse). convert the angle to a quaternion. multiply this quaternion with the rotation quaternion of the object. this gives a new rotation quaternion for the object. then this quaternion is transformed into a new rotation matrix (4x4). finally, glMultMatrix() is called with the new matrix. Every thing works but I still have the Gembal Lock !!! In the article, it is said that quaternions are not supposed to have the Gimbal Lock if the rotation are done by multiplying quaternions !! Please Help !! Thanks !
Advertisement
You must have missed the part that says, and I quote:

"Note that the above quaternion representation will also incur gimbal lock like the Euler method."

Take a closer look at the article and the source code and you will see what you are doing wrong. I used this article to learn quaternions and they work quite well, keep trying.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson

This topic is closed to new replies.

Advertisement