3d rotation: why do rotations around some axis pull other axis with them, while others dont?

280 Views Asked by At

I am trying to understand Gimbal lock. Most of the video on Youtube say that while rotation around x-axis doesn't change y and z axis, rotation around y pulls x-axis along with it and rotation around z pull both x-axis and y-axis along. I always thought if you rotate something, then the entire coordinate, x, y, z go along with it. So why do we have this order?

2

There are 2 best solutions below

0
On

You have three simple rotation matrices $R_x$ that rotate around x-axis and $R_y$, $R_z$ that rotate around y-axis and z-axis respectively.

If you combine them in the usual order, $R = R_z R_y R_x$ the effect is that the object first rotate around the x-axis only due to $R_x$, then when $R_y$ is applied the object this rotation is added on top of the previous rotation around x-axis. Finally when you apply $R_z$ rotation it is applied on top of two previous rotations.

In some youtube videos the terminology used for composition of rotations is wrong as they say that rotations are "pulling" or "dragging" some axis of rotations, leaving other axis untouched. They should say instead that rotation around one axis is composed with rotation around other axis in a specific order.

Of course if you change the order the final result is going to change, because they do not commute.

Gimbal lock is just an unfortunate combination of such simple rotations. Yielding unexpected result.

0
On

Gimbal lock is something that can occur when you have at least three consecutive rotations, and two of them happen to align.

So, it is not a phenomenon related to rotations per se, but a phenomenon related to multiple consecutive rotations.

A gimbal is a device with concentric rings, arranged so that each ring can rotate around a separate axis. The name "gimbal lock" comes from the situation when two of the three rings are in the same plane: the third ring is constrained to rotate around a single axis on that plane, and the gimbal cannot compensate for all changes in orientation.

When using Euler or Tait-Bryan angles, the actual desired orientation or rotation is composed of three successive rotations. They suffer from gimbal lock, because the two first rotations can be such that the third rotation is effectively around an axis that has been already rotated around, meaning two of the three angles cause the same change in orientation or total rotation.

The solution is simple: do not use Euler or Tait-Bryan angles. They are evil and insiduous. They look simple, but they limit your brain and implementation to a small box, that does not provide the true freedom the real world has. It is a scam by trigonometric function fetishists.

The reason unit quaternions (versors) that describe rotations do not have this problem, is because a versor can describe any orientation in a single rotation, rather than composing it of three sub-rotations.

While quaternion math is known to be complicated, versors are easy, because we only need to handle about three basic operations (quaternion multiplication, addition, and normalization to unit length), and the conversion to a three-by-three rotation matrix. Logically, a versor just describes an arbitrary axis, and the amount of rotation around that axis. To apply a consecutive rotation to a versor, you simply multiply them together (and normalize the result to unit length to compensate for numerical errors). You can do that as many times as you want, unlike for matrices; the versor won't break (rounding errors will creep into matrices, causing nonuniform scaling). Finally, you can interpolate between two versors easily, with the interpolated points drawing great circle arcs. Perfect for 3D graphics, really; and in fact, easier than Euler or Tait-Bryan angles. Why anyone still uses Euler or Tait-Bryan angles, is beyond my understanding.