I’m currently porting a WebVR app to WebXR (almost done!). Mostly in VR I want the angle of the camera to match the angle of the user’s head (to avoid nausea). But I’d like my users to be able to reset the view by rotating the whole world about them (so that the objects behind them can be moved in front of them). It’s important that the floor remain level during this manual rotation, though, regardless of the user’s head orientation.
I was able to accomplish that with WebVR before using code like this: Babylon.js Playground (click the VR goggles to start the rotation in VR).
But as you can see, with the new WebXR system, the rotation no longer occurs about the world Y axis. At the same time, I don’t think it’s rotating around any local axis either (though I could be mistaken).
In case it helps, I’ve seen this problem in:
- Chrome, macOS, using the WebXR device emulator browser extension,
- Firefox, Windows, using the WebXR polyfill (HTC Vive)
Is it possible to rotate the WebXR camera about the world Y axis, even if the user’s head is tilted to the side or forward when rotating?
Thanks for your help.