diff --git a/examples/js/effects/StereoEffect.js b/examples/js/effects/StereoEffect.js index 77ee34250aceff4f1a62be3a2bc01a9811e863c7..5b007f09e414ce395f9ef2664b6b09d63f6dddf3 100644 --- a/examples/js/effects/StereoEffect.js +++ b/examples/js/effects/StereoEffect.js @@ -1,14 +1,14 @@ /** * @author alteredq / http://alteredqualia.com/ * @authod mrdoob / http://mrdoob.com/ + * @authod arodic / http://aleksandarrodic.com/ */ THREE.StereoEffect = function ( renderer ) { // API - this.separation = 6; - this.targetDistance = 500; + this.separation = 3; // internals @@ -20,7 +20,6 @@ THREE.StereoEffect = function ( renderer ) { var _cameraL = new THREE.PerspectiveCamera(); var _cameraR = new THREE.PerspectiveCamera(); - var _target = new THREE.Vector3(); // initialization @@ -43,33 +42,27 @@ THREE.StereoEffect = function ( renderer ) { camera.matrixWorld.decompose( _position, _quaternion, _scale ); - _target.set( 0, 0, - this.targetDistance ); - _target.applyQuaternion( _quaternion ); - _target.add( _position ); - // left _cameraL.fov = camera.fov; _cameraL.aspect = 0.5 * camera.aspect; - _cameraL.updateProjectionMatrix(); - _cameraL.near = camera.near; _cameraL.far = camera.far; + _cameraL.updateProjectionMatrix(); _cameraL.position.copy( _position ); + _cameraL.quaternion.copy( _quaternion ); _cameraL.translateX( - this.separation ); - _cameraL.lookAt( _target ); // right - _cameraR.projectionMatrix = _cameraL.projectionMatrix; - _cameraR.near = camera.near; _cameraR.far = camera.far; + _cameraR.projectionMatrix = _cameraL.projectionMatrix; _cameraR.position.copy( _position ); + _cameraR.quaternion.copy( _quaternion ); _cameraR.translateX( this.separation ); - _cameraR.lookAt( _target ); // diff --git a/examples/webgl_effects_stereo.html b/examples/webgl_effects_stereo.html index c826890b392cc6dc6b0de3596f9a8e2e70a9bcd1..19dfecfe5aab54d88e94db2837e4c63174d9e3d5 100644 --- a/examples/webgl_effects_stereo.html +++ b/examples/webgl_effects_stereo.html @@ -126,7 +126,6 @@ effect = new THREE.StereoEffect( renderer ); effect.separation = 10; - effect.targetDistance = 200; effect.setSize( window.innerWidth, window.innerHeight ); //