Euler Angles - Gimbal lock, why non-orthogonal axes Already asked this question on mathexchange but didn't got any promising answers so posting it here Since I'm from a CG background.

I really can't understand how and why gimbal lock occurs using euler angles.
First of all let me clear this "I know that gimbal lock occurs when 2 gimbals/axes coincide thus losing 1 degree of freedom" 

However what I'm interested in why the axes are coinciding in the first place when they are supposed to remain perpendicular when we move anyone.

According to wikipedia here :


  The general problem of decomposing a rotation into three composed
  movements about intrinsic axes was studied by P. Davenport, under the
  name "generalized Euler angles", but later these angles were named
  "Davenport angles" by M. Shuster and L. Markley.
  
  Davenport proved that any orientation can be achieved by composing
  three elemental rotations using non-orthogonal axes.


That's what I want to hear about more. Why "non-orthogonal" ? I can't see any problems with making the axes orthogonal? What does making the axes non-orthogonal give us?

2) After the above one has been answered. How is this all tied up to rotational matrices? How can we achieve gimbal lock through the matrices when they only rotate a given point/vector around global axis. For example If i multiply a column vector with a Rotation matrix around X-axis Rx  and then with Ry It will rotate around the global X-axis first, then global Y-axis second. So how can I achieve the lock situation using matrices?

EDIT:- 
To make it more clear I've also heard about rotation orders like in the order Y-Z-X when Y axis rotates then Z and X rotate with it but when Z rotates only X rotates with it. thus making the axes non-orthogonal. I am assuming that's what it means by non-orthogonal mentioned in the wiki article. Here is a picture.



As you can see in the Y-Z-X order, the Y axis remains there as in 3rd picture causing the axes to coincide...
OK I think I know what your problem is, gimbal lock does not really lock anything from a mathematical point if view, only for certain operations. See euler suggested that euler angles can define all space angles. And that is true. Its just that euler does not say that the space is uniform. Highly mathematical people also say that the euler space has impossible solutions since some positions are overlapping, but in practice this is not really a problem.

Now since you can reach any angle, and you can always unwind your angle you can reach any angle in the body. Provided that your ready to unravel the situation and start over for a computer program doing animation and a mathematician this seems reasonable.

However, this is not what most people are doing. Instead if you try to do some physical things like calculating the distance between 2 positions, the energy needed to rotate, use a external force to move the system or make a delta move in the gimbals space then this non uniformity kicks in. Simply the space is not uniform the same way that a real space is at the poles the distance to a position next to you in real space can be surprisingly far away in Euler rotation space.

So when somebody is euler locked it does not mean they can not move anywhere they just can not move in the direction they would want to move in that particular orientation of the gimbal, and close to it. Its a bit like living in the suburbs and wanting to reach your neighbors house (that is 100 m away) but being forced to go trough the center of the city (15 km away). Energetically or time wise highly wasteful.

This is a problem in 3D graphics only if you choose to interpolate in Euler angles. But for a control engineer or a mechanical engineer this can be  a nightmare, since you can suddenly have a discrepancy between what your mechanism and your control logic is saying.

Now it is possible to construct the gimbal so that the pole does not really happen, just not with the orthogonal axes the space is still not uniform but it does not experience the extreme case. However it might just be easier to use some other formulation like quaternionions, or axis angle instead. (quaternionions aren't really practical if your building a real mechanism though, its possible but very convoluted)

PS: I would draw an image, its just that drawing something the wraps perfectly upon itself and is a 3d field is a bit difficult to do.