math & physics
In order to avoid creating gimbal locks, I want to be able to create them, understand them. Problem is I fail abysmally.
The symptoms of gimbal lock as I understand it are that after some rotations around one axis, following rotations about the other two axis look the same or at least inverted. This can only be achieved by letting the latter 2 axis (or is the plural axises?) be parallel.
I read a GameDev article which said that this comes about by using Eulerangles and matrices. Each Eulermatrix rotatates about 1 axis. Rotations about more than 1 axis is achieved by multiplying E-Matrices. Eulermatrices are orthonormal therefore the original orthogonal basis of our coordinate system gets transformed into another orthogonal system after multiplication. And orthogonal systems have no two parallel axis. It is true that there are two (or more) triples of angles that when entered into Euler matrices give the same result, but that was not described as gimbla lock.
If you always rotate about the world coordinate system, gimbal lock cannot appear either as the world coordinate system obviously has no two parallel axis.
The only way to create gimbal lock as I understand it is mixing the two methods of rotation. But mixing the two is like mixing beer and wine and complaining that it tastes bad ( I never tried, have you?).
I once suffered from gimbal lock. Or at least I *think* it was gimbal lock. I wrote a camera class and was testing in on a 2d grid. Rotating pitch and yaw was perfect, but as soon as I tried to roll it began to fudge the previous 2 axis. The more you fidel with it, the more it messed up.
I fixed this with quaternions however. Funny story... When I looked up "gimbal lock" on google it came up with this site for a band called "gimbal lock". They're a bunch of math geeks who named themselves after the matrix problem. I laughed my ass off.
As I recall gimble lock is created when all 3 axis rotations occur, this results in a overwriting of the values.
So try to do something that involves rotations along each plane simulatenously
I think gimbal lock occurs when you rotate one axis, and it is mapped onto another axis, making them parallel, and when this happens you lose a degree of freedom, because your matrix has been reduced to a 2D matrix. When you try rotate one the axis' involved, the other axis mapped onto it will follow along, and thats what its called Gimbal Lock.