I have a system providing data in the following coordinate system :
Forward : -x-axis.
Right : -y-axis.
Up: -z-axis.
I am receiving quaternions and translations on those axis.
I want to transform this data to Unity’s coordinate system :
Forward : z-axis.
Right: x-axis.
Up: y-axis.
So there is a switch between the axes and in the directions.
The goal is to put Quaternion Q & Translation T in a Matrix4x4
So, for a quaternion Q I am getting from the system, I write it as :
Quaternion(-y,-z,-x,w) and for a translation T as Vector3(-y,-z,-x)
like in the following code
Matrix4x4 point = new Matrix4x4();
point = Matrix4x4.identity;
point = Matrix4x4.Rotate(new Quaternion(-q.y,-q.z,-q.x,q.w));
point .SetColumn(3, new Vector4(-ty, -tz, -tx, 1));
Yet I am getting weird movements…
Am I doing anything wrong at this stage ?