Leo Santos


About Me

Not Specified
United States of America


Recent Forum Posts

Invert rotations in a Matrix4 May 22, 2018, 12:48 a.m.

Never mind, figured it out… maybe not the best method, so here it goes (Tz, Rx and Ry are inverted in this case):
values = dict()
values["translate"] = ( n.parm("tx").eval(), n.parm("ty").eval(), n.parm("tz").eval()*-1 )
values["rotate"] = ( n.parm("rx").eval()*-1, n.parm("ry").eval()*-1, n.parm("rz").eval() )
values["scale"] = ( n.parm("sx").eval(), n.parm("sy").eval(), n.parm("sz").eval() )

xform = hou.hmath.buildTransform( values )

Invert rotations in a Matrix4 May 20, 2018, 11:25 p.m.


I'm using Python to get the local transformations from Houdini to a game engine, but I realized that the rotations are reversed. I can't change how the engine works, so I need to export the rotation values in the matrix already inverted.

I'm a complete failure when it comes to properly understanding Matrices, and couldn't figure out how to invert just the rotation vectors in a Matrix4 object obtained with objNode.localTransform(). I even tried numpy, but my own math incompetence wins. :-(

Is there a way to do that from Python in Houdini?

Camera vertical FOV May 16, 2018, 1:15 a.m.


How can I set the vertical FOV directly in Houdini? I need the camera to match a game engine's camera that has no film back or aperture values, and simply relies on a vertical FOV (horizontal changes depending on aspect, while vertical is fixed - the opposite of Houdini's).

I'm aware of the formulas here:http://www.sidefx.com/docs/houdini/ref/cameralenses.html [www.sidefx.com]
However, I'm terrible at math, and just can't figure out how to move the “focal” variable out of the atan() function… I know it's probably really basic, but I can't figure it out!… :-(

Thanks, any help appreciated!