I found that the conversion of quaternion to Euler angles in Houdini seems to be different from the definition in mathematics. In mathematics (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), and (0, 0, 0, 1) represent Identity quantization, rotating 180 degrees around the x-axis, y-axis, and Z-axis, respectively. However, in Houdini, we use (0, 0, 0, 1) to indicate no rotation, and if we use the quaterniontoeuler function with XFORM_XYZ, we will find that (0, 0, 0, 1) corresponds to a rotation of 0 degrees on the X, Y, and Z axes.
Can someone please kindly explain to me why this is? Or is there something wrong with my understanding?
Thanks
What does each component of the Orient attribute represent?
1326 4 0- JIAYIZHAO
- Member
- 20 posts
- Joined: June 2019
- Offline
- jsmack
- Member
- 7846 posts
- Joined: Sept. 2011
- Offline
ILIAZHAO
Can someone please kindly explain to me why this is? Or is there something wrong with my understanding?
In computer science, the Real component of the quaternion is stored last and is referred to as 'w' as in xyzw for a four part vector with x y and z being the imaginary components. Mathematics texts will put the real component first similarly to how complex numbers are written. I'm not sure why the difference in convention, it may be due to efficiencies in computing or convenience.
- tamte
- Member
- 8624 posts
- Joined: July 2007
- Offline
Both conventions seem to be used, the choice may be arbitrary, here is some overview I found https://github.com/clemense/quaternion-conventions [github.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- animatrix_
- Member
- 4544 posts
- Joined: Feb. 2012
- Offline
Maybe it's because xyzw can be more intuitive for users who are familiar with working in 3D space. By placing the scalar part (w) at the end, the vector part (x, y, z) comes first, which can make it more consistent with other representations in 3D graphics such as vectors and points. But that's just my speculation.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- JIAYIZHAO
- Member
- 20 posts
- Joined: June 2019
- Offline
-
- Quick Links