What does each component of the Orient attribute represent?

   1236   4   0
User Avatar
Member
20 posts
Joined: 6月 2019
Offline
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
User Avatar
Member
7741 posts
Joined: 9月 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.
User Avatar
Member
8532 posts
Joined: 7月 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
User Avatar
Member
4495 posts
Joined: 2月 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 | animatrix2k7.gumroad.com
User Avatar
Member
20 posts
Joined: 6月 2019
Offline
Thank you all for the very useful information!!
  • Quick Links