from the guide: Unity - Scripting API: Matrix4x4.operator *
public static Matrix4x4 operator *(Matrix4x4 lhs, Matrix4x4 rhs);
should perform lhs * rhs.
but why it doesn’t work? the * operator, compute rhs * lhs.
Example:
Matrix4x4 a =newMatrix4x4();
a.m00 =1; a.m10 =0; a.m20 =0; a.m30 =0;
a.m01 =0; a.m11 =1; a.m21 =0; a.m31 =0;
a.m02 =0; a.m12 =0; a.m22 =1; a.m32 =0;
a.m03 =2; a.m13 =2; a.m23 =2; a.m33 =1;
Matrix4x4 b =newMatrix4x4();
b.m00 =1; b.m10 =0; b.m20 =1; b.m30 =0;
b.m01 =0; b.m11 =1; b.m21 =0; b.m31 =0;
b.m02 =1; b.m12 =0; b.m22 =1; b.m32 =0;
b.m03 =0; b.m13 =0; b.m23 =0; b.m33 =1;
Matrix4x4 c = a * b;
at the end, c is:
when it should be:
in order to have the correct result, I have to do
c = b * a
which is a non-sense.
**** EDITED IN ORDER TO FIX THIS TYPING MISTAKE
Matrix4x4 store values in [column|row] instead of the standard [row|column]format. I know this, and I set the Matrix accordingly… but it seems that something goes wrong.
any help?







