I am using X-files to store 3D models. I want to take rotation from X-file. In X-file rotation is represented by quaternion. I am using DirectX 11 and left-handed coordinate system. I want to create 3x3 matrix from quaternion. What should be formula of 3x3 matrix in left-handed coordinate system?
This for LHS (row-major)? [ 1 - 2yy - 2zz 2xy - 2wz 2xz + 2wy ] [ 2xy + 2wz 1 - 2xx - 2zz 2yz - 2wx ] [ 2xz - 2wy 2yz + 2wx 1 - 2xx - 2yy ]
If we want to Convert a Quaternion into Matrix in RHS. This for RHS (row-major)? [ 1 - 2yy - 2zz 2xy + 2wz 2xz - 2wy ] [ 2xy - 2wz 1 - 2xx - 2zz 2yz + 2wx ] [ 2xz + 2wy 2yz - 2wx 1 - 2xx - 2yy ]
Transformation of a right-handed matrix into a left-handed matrix is achieved by matrix transposition?
Quaternion do NOT have handedness, but matrix DO? Is it right?
Left/right handed quaternions and matrices don't exist. There are only left/right handed coordinate systems. And if you want to render an object the same way in left/right handed coordinate systems, you can use a mirror matrix with opposite axes. Just multiply one column or row of matrix by "-1".
Answering "Quaternion do NOT have handedness, but matrix DO? Is it right?".
- No matrix don't have handedness. But matrix can store mirroring transformation, quaternions can't.