tamte
and to that 'note'
in Houdini you just use matrices as they are with C*B*A order (presuming they are row based)
but because of matrices in H are row based and A, B, C in that 'note' are column based you need to transpose them first to get Houdini equivalent ones then perform C'*B'*A'
but if you have never met column based matrices and you are used to row based like in Houdini or Softimage it may seem a little confusing but for TD used to column based it may be useful info
Yeah, I was doing some testing and all the matrices seem to be transposed from what I'm used to in traditional math...
float x_translation = chf("x_translation");
float y_translation = chf("y_translation");
float z_translation = chf("z_translation");
// This didn't work
// matrix transformation = set(
// set(1,0,0,x_translation),
// set(0,1,0,y_translation),
// set(0,0,1,z_translation),
// set(0, 0, 0, 1)
// );
// This one works:
// matrix transformation = set(
// set(1, 0, 0, 0),
// set(0, 1, 0, 0),
// set(0, 0, 1, 0),
// set(x_translation, y_translation, z_translation, 1)
// );
// This one also works:
matrix transformation = set(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
x_translation, y_translation, z_translation, 1
);
v@P = v@P * transformation;
// Interestingly, this is equivalent to:
// v@P = transformation * v@P;
// and:
// v@P *= transformation;
// The documentation says that matrices are row major, but it seems that the matrices that work are transposed from matrices we'd see in traditional math.
I have two questions:
- Why are these matrices transposed like this?
- Why does the multiplication order not matter?
Thanks!