Peter O'Shaughnessy | @poshaughnessy | Press f for full screen, h for high contrast
if( navigator.getVRDevices ) {
// Chrome
navigator.getVRDevices().then( vrDeviceCallback );
} else if( navigator.mozGetVRDevices ) {
// Firefox
navigator.mozGetVRDevices( vrDeviceCallback );
}
function vrDeviceCallback( vrDevices ) {
for( var i=0; i < vrDevices.length; i++ ) {
// If instance of HMDVRDevice...
// If instance of PositionSensorVRDevice...
}
}
var leftFOV =
vrHMD.getRecommendedEyeFieldOfView('left');
var leftTrans = vrHMD.getEyeTranslation('left');
if( canvas.webkitRequestFullscreen ) {
canvas.webkitRequestFullscreen({
vrDisplay: hmdDevice });
} else if( container.mozRequestFullScreen ) {
container.mozRequestFullScreen({
vrDisplay: hmdDevice });
}
var effect = new THREE.StereoEffect( renderer );
...
effect.render( scene, camera );
var controls = new THREE.DeviceOrientationControls(
camera, true);
controls.connect();
...
controls.update();
Slides: bit.ly/interfaces-of-the-future
web-vr mailing list: bit.ly/web-vr-mailing-list