Houdini's matrices and extracting trans,rot,scale
Drew Whitehouse
Drew.Whitehouse at anu.edu.au
Thu Oct 28 20:46:22 EDT 2004
This may be due to the fact that mathematically the mapping from
matrices to euler angles isn't one to one. So even though the numbers
are different they may still give you the same rotation, just one of the
joys of euler angles I'm afraid. (btw: there is a good article on euler
angles by Ken Shoemake in Graphics Gems IV)
-Drew
Mark Story wrote:
> Wooops, I meant to say:
>
> current_input_xform =(UT_DMatrix4&)foo_node->getWorldTransform(context);
>
> int foo2 = current_input_xform.explode(xformOrder, rot, scale, trans);
> *OR*
> current_input_xform.getTranslates(trans);
>
> 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
>
> 90 0 0
> rot.x: 90.00000249272661 rot.y: 0 rot.z: 0
>
> 91 0 0
> rot.x: -269.000006312118 rot.y: 0 rot.z: 0
>
> 181 0 0 rot.x: -178.9999969892022 rot.y: 0 rot.z: 0
>
> 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
>
> 90 180 0
> rot.x: 90.00000249272661 rot.y: 0 rot.z: 90.00000249272661
>
>
> Freaky ....
>
>
> --Mark
>
>
>
More information about the Sidefx-devkit-list
mailing list