提交 1103be35 编写于 作者: M Mr.doob

Updated builds.

上级 3eac1a1b
...@@ -21277,7 +21277,7 @@ ...@@ -21277,7 +21277,7 @@
var cameraRPos = new Vector3(); var cameraRPos = new Vector3();
/** /**
* Assumes 2 cameras that are perpendicular and share an X-axis, and that * Assumes 2 cameras that are parallel and share an X-axis, and that
* the cameras' projection and world matrices have already been set. * the cameras' projection and world matrices have already been set.
* And that near and far planes are identical for both cameras. * And that near and far planes are identical for both cameras.
*/ */
...@@ -21299,22 +21299,22 @@ ...@@ -21299,22 +21299,22 @@
var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ]; var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ];
var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ]; var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ];
var leftL = leftFovL * near; var leftL = near * leftFovL;
var rightR = rightFovR * near; var rightR = near * rightFovR;
var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ]; var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ];
var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ]; var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ];
var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ]; var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ];
var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ]; var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ];
// Calculate the new camera's position offset from the // Calculate the new camera's position offset from the
// left camera. // left camera. xOffset should be roughly half `ipd`.
var zOffset = ipd / ( leftFovL - rightFovR ); var zOffset = ipd / ( - leftFovL + rightFovR );
var xOffset = zOffset * leftFovL; var xOffset = zOffset * - leftFovL;
// TODO: Better way to apply this offset? // TODO: Better way to apply this offset?
cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale ); cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
camera.translateX( xOffset ); camera.translateX( xOffset );
camera.translateZ( - zOffset * 2 ); camera.translateZ( zOffset );
camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale ); camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
camera.matrixWorldInverse.getInverse( camera.matrixWorld ); camera.matrixWorldInverse.getInverse( camera.matrixWorld );
...@@ -36946,10 +36946,10 @@ ...@@ -36946,10 +36946,10 @@
this.zoom = 1; this.zoom = 1;
this.view = null; this.view = null;
this.left = left; this.left = ( left !== undefined ) ? left : - 1;
this.right = right; this.right = ( right !== undefined ) ? right : 1;
this.top = top; this.top = ( top !== undefined ) ? top : 1;
this.bottom = bottom; this.bottom = ( bottom !== undefined ) ? bottom : - 1;
this.near = ( near !== undefined ) ? near : 0.1; this.near = ( near !== undefined ) ? near : 0.1;
this.far = ( far !== undefined ) ? far : 2000; this.far = ( far !== undefined ) ? far : 2000;
此差异已折叠。
...@@ -21271,7 +21271,7 @@ var cameraLPos = new Vector3(); ...@@ -21271,7 +21271,7 @@ var cameraLPos = new Vector3();
var cameraRPos = new Vector3(); var cameraRPos = new Vector3();
/** /**
* Assumes 2 cameras that are perpendicular and share an X-axis, and that * Assumes 2 cameras that are parallel and share an X-axis, and that
* the cameras' projection and world matrices have already been set. * the cameras' projection and world matrices have already been set.
* And that near and far planes are identical for both cameras. * And that near and far planes are identical for both cameras.
*/ */
...@@ -21293,22 +21293,22 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) { ...@@ -21293,22 +21293,22 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ]; var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ];
var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ]; var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ];
var leftL = leftFovL * near; var leftL = near * leftFovL;
var rightR = rightFovR * near; var rightR = near * rightFovR;
var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ]; var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ];
var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ]; var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ];
var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ]; var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ];
var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ]; var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ];
// Calculate the new camera's position offset from the // Calculate the new camera's position offset from the
// left camera. // left camera. xOffset should be roughly half `ipd`.
var zOffset = ipd / ( leftFovL - rightFovR ); var zOffset = ipd / ( - leftFovL + rightFovR );
var xOffset = zOffset * leftFovL; var xOffset = zOffset * - leftFovL;
// TODO: Better way to apply this offset? // TODO: Better way to apply this offset?
cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale ); cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
camera.translateX( xOffset ); camera.translateX( xOffset );
camera.translateZ( - zOffset * 2 ); camera.translateZ( zOffset );
camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale ); camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
camera.matrixWorldInverse.getInverse( camera.matrixWorld ); camera.matrixWorldInverse.getInverse( camera.matrixWorld );
...@@ -36940,10 +36940,10 @@ function OrthographicCamera( left, right, top, bottom, near, far ) { ...@@ -36940,10 +36940,10 @@ function OrthographicCamera( left, right, top, bottom, near, far ) {
this.zoom = 1; this.zoom = 1;
this.view = null; this.view = null;
this.left = left; this.left = ( left !== undefined ) ? left : - 1;
this.right = right; this.right = ( right !== undefined ) ? right : 1;
this.top = top; this.top = ( top !== undefined ) ? top : 1;
this.bottom = bottom; this.bottom = ( bottom !== undefined ) ? bottom : - 1;
this.near = ( near !== undefined ) ? near : 0.1; this.near = ( near !== undefined ) ? near : 0.1;
this.far = ( far !== undefined ) ? far : 2000; this.far = ( far !== undefined ) ? far : 2000;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册