Hello everyone.

I have a magic leap device and a NDI Polaris Vega VT (Surgical Tool Tracking) that have different coordinate systems and I want to get the position and rotation of an object from the tracker and display it in the magic leap coordinate with the correct position and rotation.

NDI tracker uses a right-handed coordinate system as follows: Up = -x, Right = y, Forward = -z.

I get the position and rotation of the object in the tracker in the form of a homogeneous transformation matrix. I also calculated a transformation matrix between two coordinate systems using the Kabsch algorithm and 4 mutual points.

Using these matrices in the form T_{ml} = T_{ndi-ml} * T_o I get the correct position of the object in magic leap (I set the position of the object from the last column of t_{ml}) but the rotation of the object is wrong and so far I can’t find a way to fix it.

I’m not sure if my methods are correct or I need to have other steps too, so I would appreciate any help with the formulas or methods.