Houdini's matrices and extracting trans,rot,scale
Jeff Lait
jlait at fiji.sidefx.com
Thu Oct 28 23:32:40 EDT 2004
On Thu, Oct 28, 2004 at 06:47:44AM -0700, Mark Story wrote:
>
> I know the rotation values returned are in radians, but what happens is
> that when I enter various values in the object's rotation fields, and
> then examine them using the code I sent they often don't match. For
> example, here's a bunch rotation x,y,z values entered into the GUI
> followed by the values returned from explode():
>
> 45 0 0
> rot.x: 45.0000012463633 rot.y: 0 rot.z: 0
Looks right...
>
> 90 0 0
> rot.x: 90.00000249272661 rot.y: 0 rot.z: 0
Good again.
>
> 91 0 0
> rot.x: -269.000006312118 rot.y: 0 rot.z: 0
Quite fine. A forward rotation by 91 degrees is the same as
a backrotation by 269 degrees.
> 181 0 0
> rot.x: -178.9999969892022 rot.y: 0 rot.z: 0
See above.
> 90 0 90
> rot.x: 90.00000249272661 rot.y: 0 rot.z: 90.00000249272661
>
> 90 90 0
> rot.x: 0 rot.y: 90.00000249272661 rot.z: -90.00000249272661
Welcome to the wonderful world of euler angles!
There is more than one collection of euler angles that
correspond to any given absolute orientation. crack, lacking any
context, cannot tell which of the triplets you desire.
If you go to the object viewport and put down two default geos
(so they have the x,y, and z markers) and set the angles to
90 90 0
and
0 90 -90
You will see that they line up perfectly.
> 90 180 0
> rot.x: 90.00000249272661 rot.y: 0 rot.z: 90.00000249272661
This one doesn't, however?
If you could print out the matrix you used to get this crack,
I could investigate. Hopefully it is just a dropped sign in
transfer..
--
- Jeff Lait
More information about the Sidefx-devkit-list
mailing list