Can someone explain why matrices m1 and m2 are not the same, and what m1 is actually doing since m1 is even different from m3?
According to msdn:
XMMatrixRotationRollPitchYaw receives the following parameters pitch -> yaw -> roll (formal parameter order),
which represents rotation around x -> y -> z (formal parameter order),
which is applied as roll -> pitch -> yaw (matrix multiplication order),
which represents rotation around z -> x -> y (matrix multiplication order).
So transformation matrix T = Ry * Rx * Rz = Ry * Rx (matrix m2), transforms a vector v as Tv.
XMFLOAT4X4 m1, m2, m3; DirectX::XMStoreFloat4x4(&m1, XMMatrixRotationRollPitchYaw(XM_PIDIV4, XM_PIDIV2, 0.0f)); DirectX::XMStoreFloat4x4(&m2, XMMatrixRotationY(XM_PIDIV2) * XMMatrixRotationX(XM_PIDIV4)); DirectX::XMStoreFloat4x4(&m3, XMMatrixRotationX(XM_PIDIV4) * XMMatrixRotationY(XM_PIDIV2));