Hython question : Rotation values in scripting ?

   1220   2   0
User Avatar
Member
301 posts
Joined: July 2005
Offline
Hi,

In the UI, rotation are input in degrees

When working programmatically, are rotation values in radians ?

When obtaining rotation values from hou.Matrix4 either via explode() or extractRotates() yields a hou.Vector3()

Rotation values use in CopyStamp SOP needs to be hou.Vector4() for it to have an effect (I tried both ‘rot’ and ‘orient’)

When mapping from 3-element to 4-element rotation values, should the w() component be set to 1 or zero or is it safe to do

rotate = hou.Vector4(matrix.extractRotates())

Cheers
Nicholas Yue
User Avatar
Member
7836 posts
Joined: Sept. 2011
Online
Rotates returned by explode matrix functions are Euler rotations. Rotations used by copy to points and point instancing are quaternions. That's why they are length 4.

Use hou.Quaternion.setToRotationMatrix() to build quaternions from a matrix.

Out of curiosity, why all the python? VEX is typically the language of working with data in Houdini.
User Avatar
Member
301 posts
Joined: July 2005
Offline
Thank you jsmack.

I am digesting the Disney Moana Island dataset as a way to learn more about HOM.

Geometry looks OK so far but getting a matching camera render is proving difficult. There is this screenwindow values which I still am not able to map them to something sensible in a Houdini camera. I think it is related to winx, winy, winsizex and winsizey

Cheers
Nicholas Yue
  • Quick Links