提交 397fc187 编写于 作者: M Mr.doob

WebVR: Testing a more raw approach.

上级 63653152
......@@ -18,12 +18,6 @@ var WEBVR = {
},
getDisplays: function () {
return navigator.getVRDisplays();
},
getMessage: function () {
var message;
......
......@@ -130,15 +130,20 @@
controls = new THREE.VRControls( camera );
effect = new THREE.VREffect( renderer );
WEBVR.getDisplays()
.then( function( displays ) {
effect.setDisplay( displays[ 0 ] );
controls.setDisplay( displays[ 0 ] );
document.body.appendChild( WEBVR.getButton( effect ) );
} )
.catch( function() {
// no displays
} );
if ( navigator.getVRDisplays ) {
navigator.getVRDisplays()
.then( function ( displays ) {
effect.setVRDisplay( displays[ 0 ] );
controls.setVRDisplay( displays[ 0 ] );
} )
.catch( function () {
// no displays
} );
document.body.appendChild( WEBVR.getButton( effect ) );
}
renderer.domElement.addEventListener( 'mousedown', onMouseDown, false );
renderer.domElement.addEventListener( 'mouseup', onMouseUp, false );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册