VEX and matrix representation

   2952   1   0
User Avatar
Member
639 posts
Joined: July 2005
Offline
Hello.

In VEX, a 3x3 matrix (for example) appears to be represented by array {1,2,3,4,5,6,7,8,9}.
If I view this array as arranged:

1 2 3
4 5 6
7 8 9

then matrix multiplication of two 3x3 matrices yielded result as expected. However, when a matrix acts on a vector, it appears this matrix will first have to be transposed. Is this a correct way to think about how VEX works with matrices and vectors?

Just wanted to get a quick clarification here so to avoid costly debugging process later that's due to a misunderstanding of VEX's matrix representation.

Thanks in advance!
User Avatar
Member
9403 posts
Joined: July 2007
Online
EigenAlex
However, when a matrix acts on a vector, it appears this matrix will first have to be transposed.
You can multiply vector directly by transform matrix to transform it accordingly

You just have to keep in mind that matrices in Houdini are row major and and therefore the order of multiplication is left to right so if you want to transform vector by matrix you multiply vector by matrix, etc

You may be used to column major transform matrices where the order is opposite
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links