Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: quaternion

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Location
    India
    Posts
    13

    quaternion

    Hi everyone, Plz tell me funda of quaternion how can we calculate from euler angle and please tell me how can I calculate q[w,x,y,z] factor.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    You don't want to calculate quaternions from Euler angles. You want to stop using Euler angles at all. You don't want, at any point in your program, to think of an object's orientation as 3 angular rotations.

    As for the why's and how's of this, I've covered that over here.

  3. #3
    Junior Member Newbie
    Join Date
    May 2013
    Location
    India
    Posts
    13
    Thanks for link, "Any pure orientation change from one coordinate system to another can be represented by a rotation about some axis by some angle" thats fine now I can visualise with some other aspect, but
    Click image for larger version. 

Name:	z_converted.png 
Views:	33 
Size:	1.0 KB 
ID:	1035


    why theta/2
    is there any derivation

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    why theta/2
    is there any derivation
    The Internet is where you are right now. If you want to know how a formula was derived, you could simply look it up. I'm sure the Wikipedia article on quaternions could explain it.

  5. #5
    Junior Member Newbie
    Join Date
    May 2013
    Location
    India
    Posts
    13
    I am unable to find out any content about half angle,please if you have any, mention it . thanks in advance.

  6. #6
    Member Regular Contributor
    Join Date
    Aug 2008
    Posts
    433
    http://en.wikipedia.org/wiki/Quatern...atial_rotation says that it is to enable the encoding of both count and counter-clockwise rotations.

    As I see it, if you were to use:
    Code :
    q = cos (theta) + (Ux*i + Uy*j + Uz*k)*sin(theta)
    Then since sin and cos repeat every 360 degrees, you couldn't tell the difference between rotating (X) degrees and (N*360+X) degrees. This would mean you could only encode rotations from -180 to +180 degrees (0-360 degrees if you are only rotating one way)

    Using:
    Code :
    q = cos (theta/2) + (Ux*i + Uy*j + Uz*k)*sin(theta/2)
    then cos & sin only repeat every 720 degrees, so you can represent -360 to 360 degree rotations. (or 0-720 degrees if only in one direction)

Posting Permissions

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