Mat33_cd.kl¶
Types¶
Mat33_cd (struct)¶
The Mat33_cd represents a 3 by 3 matrix. It uses Vec3_cd types for each of the 3 rows.
/*
** Example: Vec4
*/
// create a matrix 3x3
Vec3_cd v0(1.0, 0.0, 0.0);
Vec3_cd v1(0.0, 1.0, 0.0);
Vec3_cd v2(0.0, 0.0, 1.0);
Mat33_cd mat(v0, v1, v2);
Fabric Engine Matrices are column-major rather than row-major¶
Most DCCs follow a row-major convention for expressing their matrices which implies that multiplication of matrices occurs in the opposite order to those in Fabric Engine.
In Maya and Softimage, to transform a point (P) by a matrix (WM), you would post-multiply the vector by the matrix by placing it on the left side of the matrix.
(P’ = P x WM)
In Fabric Engine, to transform a point (P) by a matrix (WM), you would post-multiply it by placing it on the right hand side of the matrix.
(P’ = WM x P)
When multiplying matrices together, the order of the matrices is also swapped when compared to Maya/Softimage.
To Transform a Matrix (M) into the space of a another matrix (WM), you would place the L on the right hand side of WM
(M’ = WM x M)
In Maya, Softimage and 3dsmax, the order of the matrices in the multiplication would be swapped.
(M’ = M x WM)