I'm trying to do 3D reconstruction using ARKit and SceneKit. I'm able to correctly save the mesh as a .usdz file. However, the mesh works well only when the position of phone doesn't change. As soon I start to move around to scan the environment, the texture gets distorted. When I try to scan any object from all sides, the geometry also gets distorted.
I'm using didAdd and didUpdate delegate functions of ARSCNView to create SCNNode of each frame and apply the texture. At the end, the all SCNNodes are used to create SCNScene which is exported as .usdz afterwards.
Any idea how to update the geometry and texture when position and orientation of phone changes?