Houdini's matrices and extracting trans,rot,scale

Mark Story mstory at xion.org
Thu Oct 28 09:47:44 EDT 2004


Wooops, I meant to say:

current_input_xform =(UT_DMatrix4&)foo_node->getWorldTransform(context);

current_input_xform =(UT_DMatrix4&)foo_node->getWorldTransform(context);
                   *OR*
int foo2 = current_input_xform.explode(xformOrder, rot, scale, trans); 
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