Initial WebXR position same as camera position

I found a problem where the WebXR position doesn’t match the camera position when launching. Its facing to the left or right. There seems to be noway to reset it. Any ideas ? Its working on the stereo vr example but not the equi example.

Another example without camera position code. It defaults to this tilted view like in the webxr session. My own videos have the same problem when orbitcontrols is disabled. How to correct this ?

I believe this is what I need to do. Ive tried everything including something like this

renderer.xr.addEventListener(‘sessionstart’, () => {

                renderer.xr.getCamera().position.copy( camera.position);

                renderer.xr.getCamera().lookAt( );


                console.log("pos", renderer.xr.getCamera().position);


This is very strange, without a position set, the video starts 90 degrees to the real front of the camera. but in webxr it starts 180 degrees from that position. WebXR camera really needs to take the initial position from the non webxr camera. Even if I shift the geometry instead. It will show flipped in webxr and you need to turn the headset to the left.

Another test with a rotated mesh. WebXR starts in the opposite direction.

Does this code need an offset added to get the front of the camera ?

camera.matrix.fromArray( view.transform.matrix );
camera.projectionMatrix.fromArray( view.projectionMatrix );

I made another test that provides a quick fix. I position the camera to the front. Then I have to flip the mesh in webXR and the opposite direction. Then move it back.

renderer.xr.addEventListener('sessionstart', () => {

                mesh.rotation.y =  -pos;


                renderer.xr.getCamera().lookAt( );



            renderer.xr.addEventListener('sessionend', () => {

                mesh.rotation.y =  0;

                camera.position.x = pos;


Did you find a solution @danrossi?

yes on session start it needs an offset set. But there is bugs like with the non webxr camera initial x position needs to be set. It doesnt show exactly centre without fractions added.

const xrManager = this.renderer.xr,
    camera =,
    baseReferenceSpace = xrManager.getReferenceSpace(),
    offsetPosition = camera.position,
    offsetRotation = camera.rotation;

    const transform = new XRRigidTransform( offsetPosition, { x: this.config.xrTiltOffset ? offsetRotation.x : 0, y: -(offsetRotation.y - this.config.xrPanOffset), z: offsetRotation.z, w: offsetRotation.w } ),
    //const transform = new XRRigidTransform( offsetPosition, { x: offsetRotation.x, y: -(offsetRotation.y - 0.5) , z: offsetRotation.z, w: offsetRotation.w } ),
    teleportSpaceOffset = baseReferenceSpace.getOffsetReferenceSpace( transform );

    xrManager.setReferenceSpace( teleportSpaceOffset );