ARKit : Setting AR World Origin with 2 points on ground

Hi Unity lovers,

For my AR app, I have to place objets at specific coordinates, given in relative positions XYZ from a real world object. I know that, in ArKit 2.0 (and above), the AR World Origin can be changed with the function “setWorldOrigin(relativeTransform: simd_float4x4)”

So I would like my app to set the world origin that way :

  1. Scan the ground a bit until ArKit find the ground plane (like all the others AR apps)

  2. Pick 2 points (for exemple A et B) on the ground, near to my reference real world object.

  3. Set the AR World Origin position to A, and the AR World Origin orientation to A-B vector (for the +x axis for exemple)

Someone could explain me how can I achieve that ?

Thanks a lot for any help !

I’m the author of this post, and I think I have finally found an interesting function that could be the answer of what i’m looking for : this function is “MakeContentAppearAt(Transform, Vector3, Quaternion)”
“This method does not actually change the Transform of content; instead, it updates the ARSessionOrigin’s Transform such that it appears the content is now at the given position and rotation”
(Class ARSessionOrigin | Package Manager UI website)
If someone have already try this, let me know if it works !
Thanks