My Swift ARKit app needs the position and orientation of the face relative to the front-facing camera. If I set ARConfiguration.worldAlignment = .camera all I need to do is call for the faceAnchor.transform, which works perfectly; but my app needs to run in the default worldAlignment = .gravity so it can work properly with virtual content. In this mode I can get faceAnchor.transform and camera.transform, which are both supplied in world coordinates. How can I use those transforms or other data/methods to get the face anchor in camera coordinates? (Specifically, I need a transform that comes out the same as the direct result from worldAlignment = .camera.) I've tried multiplying those together as well as multiplying one by the other's inverse, in all four order combinations, but none of these results works. I think I am missing something basic. Help?!?!
Translate ARKit face anchor to camera coordinates
Add a Comment