Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Gimbal Angles and quaternion

  1. #11
    Advanced Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    595

    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. #12
    Member Regular Contributor DmitryM's Avatar
    Join Date
    Mar 2009
    Location
    Toronto
    Posts
    436

    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.

    Your initial statement was about quaternions, not matrices:
    You can get gimbal lock with quats too.

  3. #13
    Advanced Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    595

    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.
    Your initial statement was about quaternions, not matrices:
    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. #14
    Junior Member Newbie
    Join Date
    Sep 2010
    Location
    Arkansas
    Posts
    1

    Re: Gimbal Angles and quaternion

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

  5. #15
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    1
    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. #16
    Newbie Newbie
    Join Date
    Jul 2012
    Posts
    2
    hey thankz a lot but how to avoid gimble lock using matrices

  7. #17
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,891
    Quote Originally Posted by puneet123 View Post
    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
  •