# Rotation matrix with determinant -1 (Gimbal lock?)

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

Originally posted by torbjoen:
[b]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?
[/b]

Right. 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