Created
November 8, 2014 01:06
-
-
Save caseyyee/e68104c2105c115067d1 to your computer and use it in GitHub Desktop.
Possible flicker fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setRenderMode(mode) { | |
var modes = VRClient.renderModes; | |
if (mode == modes.mono) { | |
console.log('Mono mode'); | |
controls = new THREE.VRControls( camera ); | |
effect = renderer; | |
cursor.setMode('mono'); | |
cursor.hide(); | |
} else if (mode == modes.stereo) { | |
console.log('Stereo mode'); | |
// controls = new THREE.DeviceOrientationControls( camera ); | |
controls = null; | |
effect = new THREE.StereoEffect( renderer ); | |
//cursor.setMode('centered'); | |
cursor.disable(); | |
} else if (mode == modes.vr) { | |
console.log('VR mode'); | |
controls = new THREE.VRControls( camera ); | |
effect = new THREE.VREffect( renderer ); | |
cursor.setMode('centered'); | |
cursor.show(); | |
} | |
effect.setSize( window.innerWidth, window.innerHeight ); | |
} | |
// handle render mode changes from VR client and set appropriate renderer and control for mode. | |
VRClient.onRenderModeChange = setRenderMode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment