Jump to content

Multiply vector3 and matrix3 in Python?


Recommended Posts

Not sure exactly what you are referring to, but if you look at the docs for the various classes you will see that a hou.Vector3 can be multiplied by a 3x3 or 4x4 matrix depending on what you are trying to do.

http://www.sidefx.com/docs/houdini12.0/hom/hou/Vector3#__mul__

http://www.sidefx.com/docs/houdini12.0/hom/hou/Matrix4

Link to comment
Share on other sites

Hi Graham, are you sure? Because when I did vector3 * matrix3x3, I got a compile error. Also in the help, the signature for the multiplication is:

__mul__(self, scalar_or_matrix4)

so either scalar or matrix4.

Please let me know if I can actually use a matrix3x3. When I try, it gives a compile error, which is what led me to the help file :)

Link to comment
Share on other sites

You can ignore my post because I'm an idiot and didn't pay enough attention to the docs while also thinking about the HDK. This should be possible since Houdini stores its data in row-major format and you can multiply a UT_Vector3T by a UT_Matrix3T. The issue is that hou.Vector3 merely has no __mul__ method that accepts a hou.Matrix3. I've submitted an RFE for the missing functionality. Georg is right in that you should convert to a Matrxi4 to do the multiplication. Sorry for being dumb.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...