I know that we can use matrix4x4.TRS() but I want to demonstrate about transformation order, so I use a quaternion for rotation and a translation matrix (4x4). But I do not know how to multiply it using “*” operator?
I also test to multiply a quaternion with a vector, then a translation matrix with a vector, but the result is different as testing with another tool.
As you can see they “kind of” generate a 3x3 matrix but without going through the Matrix4x4 class which would be wuite a bit overhead. However you can simply use this to create a Matrix4x4 out of the quaternion.
However it’s probably way easier to use
var rotation = Matrix4x4.TRS(Vector3.zero, yourQuaternion, Vector3.one);
Finally you can decide on your own in which order you multiply the matrices together.
Why not directly multiply it with another quaternion got from Matrix4x4.rotation? Quaternion has the character that it is multipliable.
Why not directly multiply it with another quaternion got from Matrix4x4.rotation? Quaternion has the character that it is multipliable.
– TNY_O_O