Not able to reset camera position in WebXR

Hi All,

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.

Regards
Srinivas

Hi,

Any help regarding this will be appreciated. Also, if you need more info I’ll be happy to assist

Thanks

Hi, you should not move the camera directly in VR, put the camera in a Group and move the Group.

Hi @felixmariotto

Yes, thats what I am doing at the moment.

Anyways, I found out that this was a bug in my application code and precision error happened due to this bug which I got fixed.

Thanks for the reply anyways. I appreciate it.

Thanks
Srinivas