# Thread: Gimbal Angles and quaternion

1. ## Re: Gimbal Angles and quaternion

Rosario, you miss the point. Quaternions are able to represent _ALL_ rotations, but so are Euler rotation matrices, including the gimbal lock case rotations. They are simply a parametrization. You can avoid gimbal lock with matrices much the same as with quaternions.

2. ## Re: Gimbal Angles and quaternion

Oh, come on, ugluk! Wiki does a complete definition of the gimbal lock: http://en.wikipedia.org/wiki/Gimbal_lock

The gimbal system is a physical representation of Euler rotation coordinate space. It has a lock, but it has nothing to do with quaternions.

You can avoid gimbal lock with matrices much the same as with quaternions.
Matrix contain arbitrary rotation, but it does not represent a particular rotation coordinate space (you can't just change any component and still have a rotation matrix). It can be constructed from both Euler and quaternion given rotations.

You can get gimbal lock with quats too.

3. ## Re: Gimbal Angles and quaternion

Matrix contain arbitrary rotation, but it does not represent a particular rotation coordinate space (you can't just change any component and still have a rotation matrix). It can be constructed from both Euler and quaternion given rotations.
What do you mean by "it does not represent a particular rotation coordinate space". Certainly, the columns of a rotation matrix are the basis vectors of a "coordinate space". That's why the rotation matrices are orthogonal.

You can even change any component of the matrix and reorthogonalize and renormalize the matrix. With quats you need to renormalize the quat.
I gave you a reference to an example, so please comment on the example. I did not say I used quats built from euler matrices in my programs.

4. ## Re: Gimbal Angles and quaternion

thanks for this one.. it helps me a lot.

5. Ok....
I am making a helicopter sim.
I use euler to quaternions to rotate my camera perfectly.
No gimbal lock.

However....
When you rotate an object, the object will gimbal lock...whether using euler matrix, or euler quaternions.

If you see a flight sim using opengl...they are cheating the gimbal lock im sure of it.
My guess is they are using an invisible viewport with a cam rotating around the object in question,
then posting it as an image.

Woops, didnt mean to release any secrets, just trying to promote more flight sims!

6. hey thankz a lot but how to avoid gimble lock using matrices

7. Originally Posted by puneet123
hey thankz a lot but how to avoid gimble lock using matrices
Do not build the rotation matrix from component rotations. Build it from a representation where the rotation is succinctly represented by a single rotation.

An example of this (if applied properly) is a unit quaternion. If you need to handle, not just changes in rotation, but changes in translation too, consider using a dual unit quaternion.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•