PDA

View Full Version : Rotation matrix with determinant -1 (Gimbal lock?)



torbjoen
09-11-2003, 04:39 AM
Hi,

I have a rotation matrix that at certain frames has a determinant of -1. As I have understood, this tells that the matrix is not a real rotation matrix, that it contains a reflection. I have a "gimbal lock", right?

Anyway, I have seen some sample sourcecode that deals with this by first checking if the determinant is -1. If it is, then all cells of the rotation matrix are negated (R[i][j] = -R[i][j]).

If I do that, I still have to rotate my matrix -180 around the z-axis, for some reason. And after that, the graphics seem to be "heightened" a little bit.

Anybody got a suggestion/solution to this problem?

-And no, I am not converting to quaternions (unless you have a painless way of going from a rotation matrix with determinant=-1 to a correct unit quaternion)

Thanks!!!

Torbjørn

09-11-2003, 11:52 AM
Originally posted by torbjoen:
Hi,

I have a rotation matrix that at certain frames has a determinant of -1. As I have understood, this tells that the matrix is not a real rotation matrix, that it contains a reflection. I have a "gimbal lock", right?


Right. http://www.opengl.org/discussion_boards/ubb/tongue.gif
More serious is talking about a reflection in the rotation matrix nonsense and gimbal lock is another problem. Here is two links about the rotation matrix and gimbal lock
http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html
http://www.sjbaker.org/steve/omniv/eulers_are_evil.html