Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Huzzah

Quaternions

This topic is 5225 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I understand that orientations (rotations) can be represented as quaternion e.g. (0 0.38268 0 0.92388) represents a 45 degree rotation along the X axis. I can work the calculation for this quaternion backwards and get 44.999 degrees as the answer. But what about this (0.35355 0.35355 0.14645 0.85355)? I know the X and Y axis are involved, but stumped on how you calculate the angle(s) used in this example. Any ideas????

Share this post


Link to post
Share on other sites
Advertisement
Here is a simplified way to get the axis/angle representation from a quaternion:

halfangle = acos( w ); // in radians

angle = halfangle * 2; // in radians
axisX = x / sin( halfangle );
axisY = y / sin( halfangle );
axisZ = z / sin( halfangle );

Share this post


Link to post
Share on other sites
BTW, [ 0 0.38268 0 0.92388 ] represents a 45 degree rotation around the Y axis (assuming the elements are [ x y z w ]).

Maybe that is the problem -- [ x y z w ] vs. [ w x y z ].

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!