Converting camera tracking coordinate system?

I am working with the Vive Mars Camtrack and running into issues when trying to conform the tracking data to TouchDesigner’s coordinate system. The Camtrack is very Unreal Engine oriented and as a result I think the FreeD streams are in UE’s funky left-handed coordinate system. I have tried simply inverting axes and rotation values but there are still discontinuities between the orientation of the rover and the camera inside TouchDesigner. My suspicion based on research & other posts is that some more advanced matrix math is required.

There are a couple other posts on this topic however nothing specific to this tracking system. I am just getting lost in the weeds on the linear algebra and am curious if anyone else has solved this problem yet.

1 Like

With some kind help from @Jarrett we worked it out- .toe file attached. I was mostly overthinking the problem. There are still gimbal lock issues but that is expected with Euler rotations.
camtrack fix.toe (4.4 KB)