XR Repositioning to match ArUco markers with world center

Give us as much detail as possible regarding the issue you’re experiencing:

Unity Editor version: Unity 6000.0.43f1
ML2 OS version: 1.12.0
Unity SDK version: 2.6
Host OS: Windows 11

Hello! I’m creating a multiplayer experience and I want to show different objects always facing each player glasses in a real table. To achieve that, I track 4 ArUco markers with a cross pattern (+) that I put them on the table. I want to reposition in code the XR Origin to make the World position (0, 0, 0) be in the center of the markers.

I have been able to track the markers and calculate their world positions using the next documentation: Marker Understanding Example | MagicLeap Developer Documentation.

With that, I have calculated the center of the cross and the distance between that and the XROrigin Camera, and reposition it with the XROrigin.MoveCameraToWorldLocation() method.

My problem is that I’m not able to give the XROrigin the proper rotation, each time I start the application and reposition the XROrigin, the rotation of the world is different. I think I’m missing something. My goal is to make the world look at the glasses when I reposition them.

Thank you so much,
Juanjo

Since this question is generally a Unity based question, you may find more detailed answers on the Unity Discussion or Unity Forum websites. I don’t have a direct answer for you but you can take a look at the XROrigin API. It looks like it has a function called MatchOriginUpCameraForward which might do what you want it to.

Okay, i will try that.
Thanks!