Jump to content
Hash, Inc. Forums
Willi

euler to quaternion. quaternion to euler

Recommended Posts

hi,

 

how i can convert euler angles (as angles, not radian) to quaternions and wise versa (quaternions to euler)?

is there a function in the sdk?

Share this post


Link to post
Share on other sites

thanx nemyax.

i found it. RotateEuler does the trick for converting from quaternions.

to quaternion i found something in Rotate.h, like this

 

Quaternion quat;

RotateEuler euler;

euler.x = 10; euler.y = 20; euler.z = 30;

if ( euler.z )

quat = YXZRotateQ( euler.y, euler.x, euler.z );

else

quat = YXRotateQ( euler.y, euler.x );

 

maybe this can be shorter like:

 

Quaternion quat;

RotateEuler euler;

euler.x = 10;

euler.y = 20;

euler.z = 30;

quat= Quaternion(euler);

Share this post


Link to post
Share on other sites

euler.x = 10;

euler.y = 20;

euler.z = 30;

These should be in radians.

Share this post


Link to post
Share on other sites

this can be in degree, because YXZRotateQ converts degree to randians...

i tested it.

also RotateEuler euler(quat) converts quaternion (radians) to euler (degree).

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...