提交 3d0dc519 编写于 作者: M Michael Blix 提交者: Mr.doob

StereoEffect set eye separation (#9432)

上级 527ceee8
......@@ -16,6 +16,12 @@ THREE.StereoEffect = function ( renderer ) {
};
this.setEyeSep = function ( eyeSep ) {
_stereo.eyeSep = eyeSep;
};
this.render = function ( scene, camera ) {
scene.updateMatrixWorld();
......
......@@ -12,6 +12,8 @@ function StereoCamera() {
this.aspect = 1;
this.eyeSep = 0.064;
this.cameraL = new PerspectiveCamera();
this.cameraL.layers.enable( 1 );
this.cameraL.matrixAutoUpdate = false;
......@@ -49,7 +51,7 @@ Object.assign( StereoCamera.prototype, {
// http://paulbourke.net/stereographics/stereorender/
var projectionMatrix = camera.projectionMatrix.clone();
var eyeSep = 0.064 / 2;
var eyeSep = this.eyeSep / 2;
var eyeSepOnProjection = eyeSep * near / focus;
var ymax = near * Math.tan( _Math.DEG2RAD * fov * 0.5 );
var xmin, xmax;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册