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.
Multiply vector3 and matrix3 in Python?
Started by magneto, Jun 09 2012 09:39 PM
6 replies to this topic
#1
Posted 09 June 2012 - 09:39 PM
#2
Posted 09 June 2012 - 10:54 PM
Quote
Note that you can construct a general transformation Matrix4 from a Matrix3 by writing hou.Matrix4(matrix3).
The Industrial Parametrization of the World
http://rdg.preset.de/
http://rdg.preset.de/
#3
Posted 10 June 2012 - 12:37 AM
Thanks, that's how I did but found it strange it wasn't supported by default.
#4
Posted 10 June 2012 - 07:16 AM
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.co...Vector3#__mul__
http://www.sidefx.co...hom/hou/Matrix4
http://www.sidefx.co...Vector3#__mul__
http://www.sidefx.co...hom/hou/Matrix4
I write python and break things.
#5
Posted 11 June 2012 - 06:19 AM
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
__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
#6
Posted 11 June 2012 - 07:00 AM
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.
I write python and break things.
#7
Posted 11 June 2012 - 07:26 AM
Np man
Thanks for submitting an RFE for this. Hopefully it will be added one day. AT least now there is a workaround.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











