I have been creating a WebXR based Virtual reality application where the user just moves around a simple scene and just interacts with different objects. I am using Oculus Rift S for testing.
I have been facing this precision issue, where when I try to reset the camera back to the original position the position seems to be slightly off. Each time I reset the camera, the camera is pretty close to the original position but not quite there.
This is what I do: I have added a camera group so that it helps me changing camera position during teleportation:
this.camera = new PerspectiveCamera(fov, el.clientWidth / el.clientHeight, 0.1, 1000); //Set initial position this.camera.position.set(0,1.6,0); this.scene.add(this.camera); //Add group for teleportation help this.cameraGroup = new Group(); this.cameraGroup.add(this.camera); this.scene.add(this.cameraGroup);
To reset back to the original position I do this:
//Set the camera back to the original position this.camera.position.set(0,1.6,0); this.cameraGroup.position.set(0.0,0.0,0.0);
Although this does reset back the XR camera back very close to the original position the camera is always half a meter or so off.
What could be happening here? Any help regarding this would be invaluable.