Anim8or Community

General Category => General Anim8or Forum => Topic started by: Harvey Birdman on July 06, 2008, 07:53:12 pm

Title: Quaternion->Euler Angle -> Quaternion?
Post by: Harvey Birdman on July 06, 2008, 07:53:12 pm
Has anyone (the author?) ever published conversion forumulas for converting Anim8or orientation quaternions to Euler angles and vice versa? I'm working on porting paths to an application that requires orientation data in Euler angle format; it also has a different coordinate system orientation. My first attempt to derive conversion formulas seems to have gone south somewhere; I'm hoping someone has a known good set I could peek at.
Title: Re: Quaternion->Euler Angle -> Quaternion?
Post by: NickE on July 06, 2008, 08:25:58 pm
Anim8or uses regular quaternions.  One can convert quaternions to Euler angles readily.  The formulas shown on the Wikipedia page at http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles (http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles) work.  In the nomenclature of the Wikipedia, the q0 is the same as w, q1 is x, etc.

If you need help writing a script to do the conversion, let me know.


Title: Re: Quaternion->Euler Angle -> Quaternion?
Post by: Suppastar on July 06, 2008, 08:47:46 pm
Ouch, After reading that Wiki page my brain hurts :P

What are these Euler Angle's used for? Precise 3D to real-life measurement?
Title: Re: Quaternion->Euler Angle -> Quaternion?
Post by: Harvey Birdman on July 06, 2008, 11:37:51 pm
Thanks, Nikke. I was hoping for the permutation specific to the axes arrangment in Anim8or, but the general form on the Wiki page looks like it'll adapt readily enough. Thanks! (And thanks for the q0-w confirmation. That eliminated another nagging doubt.)

Suppastar - they're both (quaternions and euler angles) used for keeping track of the rotational orientation of an object as it's being moved around. Some things are easier and/or more efficient to calculate with Euler Angles, others with Quaternions, so bouncing from one representation to another is common.