# Who knows "Gimbal Lock" clearly?

This topic is 5062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

when i read some books in computer graphics, i meet "gimbal lock". i know that ti's a phenomenon when we rotate objects with eular angles. and we can avoid it by quaternion. but i can't imagine what is "gimbal lock"..., and learned it unclearly. anyone who knows it clearly can explain it to me? thanx a lot!!

##### Share on other sites
Not very surprising. If, for a game programmer, anything related to axis rotation doesn't work out as expected, he'll cry "gimbal lock" :)

I'll refer to this wikipedia article:
Wikipedia: Gimbal Lock

Maybe also of interest to see where Gimbal Lock actually happens:

-Markus-

##### Share on other sites
And in labours terms:
The Gimbal Lock occurs if you i.e. rotate you y-axis around your x-axis by Pi/2. Then your y-axis will be rotated down in your z-axis and you will loose a degree-of-freedom. Any rotation around your y-axis will here after be identical to a rotation around the z-axis!

If you've ever seen the movie Apollo 13, you'll notice that one of the astronauts yell "Oh no! It's the Gimbal Lock!" when they'll have to steer manually :)
Gimbals wasen't implemented in the first space-ships due to their weight and astronauts were actually trained to work around the Gimbal Lock ;)

Best regards,
Roquqkie

##### Share on other sites
Quote:
 Original post by RoquqkieAnd in labours terms:The Gimbal Lock occurs if you i.e. rotate you y-axis around your x-axis by Pi/2. Then your y-axis will be rotated down in your z-axis and you will loose a degree-of-freedom. Any rotation around your y-axis will here after be identical to a rotation around the z-axis!

i rotate my y-axis around my x-axis by Pi/2, then my y-axis will be rotated down in my z-axis. but at this time, my z-axis is not there, it also rotated...

can you say it more clearly :) thx~~

##### Share on other sites
Quote:
 Original post by KwizatzWhat is Gimbal Lock and why does it occur?

when the "gimbal lock" occurs, the object don't rotate correctly? or even don't rotate?

##### Share on other sites
it rotates, but the rotations are applied serially, first the rotation on the X axis, then the rotation on the Y axis and finally the rotation on the Z axis, by the time you get to Z, Z may have become the same as X thus you lose one degree of freedom.

##### Share on other sites
Quote:
 Original post by Kwizatzby the time you get to Z, Z may have become the same as X thus you lose one degree of freedom.

i can't understand "Z may become the same as X". Do you mean that when the z-axis rotation is over, the object's position is the same with position after x-axis rotation?

there are 2 transformations:

1) rotate on x-axis, the angle, for example, is alpha. then rotate on y-axis, the angle is Pi/2.

2) rotate on y-axis, Pi/2, then rotate on z-axis, the angle is alpha.

the 2 transformations get the same result. the position of the object is the same. thus, a degree of freedom is lost.

is it a "Gimbal Lock"?

if i use quaternion to rotate it, the result is what?

Thanx for the warmhearted-man who try to explain "gimbal lock" to me. Thank you!

##### Share on other sites
Imagine you are standing on a very flat desert, staring at a point on the horizon. X is right, Y is up, Z is forward. There are three directions you can rotate:

Y: turn left or right in a circle
X: look up or down
Z: turn your head around so that up becomes right, becomes down, becomes left, etc.

Now as you rotate around X upwards towards straight up, notice what happens to Y and Z. The Y rotation follows smaller and smaller circles around the sky as you look higher up, and Z is still just turning the whole image around its center.

When X is 90 degrees and you're looking straight up, Y (turning around in a circle) is the same as Z (turning your head) because the two are aligned. This alignment is called Gimbal Lock.

Quaternions are essentially a rotation in 4 dimensional space, with four axes so they don't lock, however they have other issues which I don't have the time to explain - there are books devoted to that kind of thing.

Tom

##### Share on other sites
Quote:
Original post by nasi
Quote:
 Original post by Kwizatzby the time you get to Z, Z may have become the same as X thus you lose one degree of freedom.

i can't understand "Z may become the same as X". Do you mean that when the z-axis rotation is over, the object's position is the same with position after x-axis rotation?

there are 2 transformations:

1) rotate on x-axis, the angle, for example, is alpha. then rotate on y-axis, the angle is Pi/2.

2) rotate on y-axis, Pi/2, then rotate on z-axis, the angle is alpha.

the 2 transformations get the same result. the position of the object is the same. thus, a degree of freedom is lost.

is it a "Gimbal Lock"?

if i use quaternion to rotate it, the result is what?

Thanx for the warmhearted-man who try to explain "gimbal lock" to me. Thank you!

Yes, you have got it. Gimbal lock happens because the angles are given in terms of moving axes. Resulting in that at certain angles and sets of rotations a degree of freedom is lost when two angles begin to describe the same axes (rotations). Gimbal lock does not happen with quaternions.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634134
• Total Posts
3015749
×