提交 ebe81838 编写于 作者: R rNix

Removed webvr-polyfill, implemented VR fallback

上级 39e9d272
此差异已折叠。
......@@ -27,28 +27,11 @@
</style>
<script>
WebVRConfig = {
// Forces availability of VR mode.
FORCE_ENABLE_VR: true, // Default: false.
// Complementary filter coefficient. 0 for accelerometer, 1 for gyro.
//K_FILTER: 0.98, // Default: 0.98.
// How far into the future to predict during fast motion.
//PREDICTION_TIME_S: 0, // Default: 0.050s.
// Flag to disable touch panner. In case you have your own touch controls
//TOUCH_PANNER_DISABLED: true, // Default: false.
// Enable yaw panning only, disabling roll and pitch. This can be useful
// for panoramas with nothing interesting above or below.
//YAW_ONLY: true, // Default: false.
// To disable keyboard and mouse controls. If you implement your own.
//MOUSE_KEYBOARD_CONTROLS_DISABLED: true // Default: false
}
</script>
</head>
<body>
<button id="VrMode">VR MODE</button>
<script src="../build/three.min.js"></script>
<script src="js/libs/webvr-polyfill.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script src="js/controls/VRControls.js"></script>
<script src="js/effects/VREffect.js"></script>
......@@ -70,10 +53,21 @@
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 90, window.innerWidth / window.innerHeight, 1, 10000 );
camera.position.z = 0.0001;
camera.layers.enable(1);
effect = new THREE.VREffect( renderer );
vrControls = new THREE.VRControls( camera );
if ( navigator.getVRDevices ) {
vrControls = new THREE.VRControls( camera, vrFallback );
} else {
vrFallback();
}
var textures = getTexturesFromAtlasFile( "textures/cube/sun_temple_stripe_stereo.jpg", 12 );
......@@ -148,6 +142,13 @@
}
function vrFallback() {
vrControls = new THREE.OrbitControls( camera );
document.querySelector( '#VrMode' ).style.textDecoration = "line-through";
}
function requestFullscreen() {
effect.setFullScreen( true );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册