A set of simple tests for testing WebVR functionality. See https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API for the latest on the documentation. The tests included here are:
- VRDevice test: Uses navigator.getVRDevices() to retrieve the VR devices attached to the computer, and prints out some information about each one, retrieved from the properties of each one.
- PositionSensorVRDevice test: Here HTML5 canvas 2D is used to fake a simple VR scene - a Firefox logo projected onto a white background, drawn twice for the left and right eyes. PositionSensorVRDevice.getState() is used to retrieve a VRPositionState object (stored in the PosState variable) from which position and orientation data is derived and used to update the position of the drawn scene. The scene is updated every frame using requestAnimationFrame().
- Velocity/Acceleration test: The demo is the same as the PositionSensorVRDevice test, except that the information output at the bottom of the display is the linearVelocity, linearAcceleration, angularVelocity and angularAcceleration.
- Simple 3D position/orientation: A very simple 3D scene that uses very similar calculations to the PositionSensorVR device demo listed above to work out scene rendering updates in reaction to VR headset movements. This scene however uses Three.js for rendering, with the Mozilla VR team's threejs-vr-boilerplate code for adding the VR view effect.
- VREyeParameters test: A version of the simple 3D scene that includes buttons that output the VREyeParameters for each eye.