magneto Posted June 10, 2012 Share Posted June 10, 2012 It seems like the help file says only vector4 and matrix4 multiplication is possible. Is this true? How can I multiply a vector3 with matrix3? Thanks. Quote Link to comment Share on other sites More sharing options...
rdg Posted June 10, 2012 Share Posted June 10, 2012 Note that you can construct a general transformation Matrix4 from a Matrix3 by writing hou.Matrix4(matrix3). 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted June 10, 2012 Author Share Posted June 10, 2012 Thanks, that's how I did but found it strange it wasn't supported by default. 1 1 Quote Link to comment Share on other sites More sharing options...
graham Posted June 10, 2012 Share Posted June 10, 2012 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 Quote Link to comment Share on other sites More sharing options...
magneto Posted June 11, 2012 Author Share Posted June 11, 2012 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 Quote Link to comment Share on other sites More sharing options...
graham Posted June 11, 2012 Share Posted June 11, 2012 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. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted June 11, 2012 Author Share Posted June 11, 2012 Np man Thanks for submitting an RFE for this. Hopefully it will be added one day. AT least now there is a workaround. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.