sprockets A:M Decaling Screen frosted donut medals buildings Rubik's Cube Nidaros Cathedral Tongue Sandwich
sprockets
Recent Posts | Unread Content | Previous Banner Topics
Jump to content
Hash, Inc. - Animation:Master

Recommended Posts

Posted

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?

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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);

Posted

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

i tested it.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...