How to stop HMD overriding camera position in WebVR/WebXR?

Once entering WebXR, I can’t find a way to keep the camera position locked. I still need the HMD to control rotation, but is there a way to set the camera in one fixed position in xyz?

Unless I’m missing something, I don’t think just setting the camera position manually each frame works, because the HMD is able to override this.

(I’m aware a fixed camera position isn’t advised for most use-cases, but it would be good to know for unique scenarios)

Any help would be appreciated, thank you!

Is this because you want some kind of HUD?
It seems strange to not want the scene camera to update when you move your head.

I’m creating pre-rendered scenes for a tour (with stereoscopic cubemaps), but I’m using some 3D objects as hotspots that visually appear to be in the pre-rendered scene. Unfortunately the effect is only convincing if the user doesn’t move their head. As soon as they move and the camera is transformed, the illusion is broken.

Sorry, but it’s not possible to do this unless you modify WebXRManager.getCamera(). And I doubt there are compelling reasons for making the camera transformation configurable with a new API.

1 Like

Fair enough, I understand it’s definitely not an intended use-case. I’ll explore some other ways to get the visual effect I’m after. A temporary fix has been moving all scene objects to match the camera transformation (but that seemed a bit overkill). Thanks for the advice.

maybe the roller coaster example can give you some similar option
https://threejs.org/examples/webxr_vr_rollercoaster.html

2 Likes

Could you solve it some other way? Having this same issue with camera to texture.