1

I am using AFrame 1.2.0 to develop a VR application and I am struggling with an issue for several days. My goal is to allow the user to see a specific view that is set programmatically and that is absolutely unrelated to the current device orientation. In other words, I should:

  • stop the user see the world based on its device orientation;
  • force the user to see a specific point (which I set programmatically);

These steps basically mean I should be able to:

  • disable the user-device rotation (UNRESOLVED for VR-Mode )
  • set the view to a specific position with a "refresh" rate (DONE)

As I wrote, the issue is related to the first point: disabling the user-device orientation and it only affects the VR mode. Indeed, everything works properly when the view is NOT in VR-Mode, but when entering in VR-Mode I can't do it anymore.

I tried managing these framework/library/APIs:

  • AFrame, look-controls: I know it is possible to disable look-controls with some properties (e.g. enabled, magicWindowTrackingEnabled, magicWindowControls): it works, but only when the view is NOT in VR-Mode; (note that hmdEnabled is no more in AFRAME from 0.8v because, as far as I understood, the introduction of WebXR does not allow to manage device directly from AFrame);
  • THREE.DeviceOrientationControls: I know that under the hood the look-controls component uses this THREE-element, so I debugged it and tried to manage it directly (e.g. calling disconnect, dispose, enabled=false): again, it works but only when the view is NOT in VR-Mode;
  • WebXR: at the lowest lever, WebXR is the last API used. I debugged it and I try to manage the WebXR session, but everything is in Read-Only mode and it seems there is no function to activate/deactivate device sensors.

So, here the question: how to disable the device orientation in VR mode with AFrame/THREE/WebXR or whatever?

Thank you all.

Timon
  • 76
  • 7

0 Answers0