I'm attempting to enable Oculus Rift DK2 orientation input for WebVR, using either Three.js' VRControls (
examples/js/controls/VRControls.js
) or directly from the PositionSensorVRDevice
.
However, the values of orientation
and position
in the PositionSensorVRDevice
are consistently either null
(in Firefox) or VRPoint3D/4Ds with x,y,z values set to 0 (in Chrome), causing the camera orientation to remain static.
The various versions of Firefox and Chrome VR builds I have experimented with include:
- Firefox 2014-10-18 version
- Chromium_WebVR_OSX_SDK_0.4.2.dmg
While I am able to obtain a PositionSensorVRDevice successfully, it appears that it may not be the authentic one, as Chrome identifies it as:
- deviceId: debug-0
- deviceName: Moculus Rift
- hardwareUnitId: debug-0
And Firefox reports it as:
- deviceId: somedevid
- deviceName: HMD Position Device
- hardwareUnitId: unknownHMDInfo-0x1351d4000
I encountered the same issue while experimenting with the Leap Motion VR Quickstart demo and the Three.js WebGL Effects VR demo. Similarly, a previous demo I worked on a few months ago, which previously functioned properly - even though it doesn't utilize VRControls but interfaces directly with PositionSensorVRDevice.
To note, my Oculus Rift is properly connected and the Demo Scene from the Oculus Rift Config Util is operating as expected. The firmware version is updated to 2.12.
In the VRControls code, the crucial section is the update method where I've been examining the values of state.orientation
and state.position
:
this.update = function () {
if ( vrInput === undefined ) return;
var state = vrInput.getState();
if ( state.orientation !== null ) {
object.quaternion.copy( state.orientation );
}
if ( state.position !== null ) {
object.position.copy( state.position );
}
};
Any advice or suggestions would be greatly appreciated!