瀏覽代碼

Updated builds.

Mr.doob 6 年之前
父節點
當前提交
1103be3532
共有 3 個文件被更改,包括 156 次插入155 次删除
  1. 11 11
      build/three.js
  2. 134 133
      build/three.min.js
  3. 11 11
      build/three.module.js

+ 11 - 11
build/three.js

@@ -21277,7 +21277,7 @@
 	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.
 	 * And that near and far planes are identical for both cameras.
 	 */
@@ -21299,22 +21299,22 @@
 
 		var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ];
 		var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ];
-		var leftL = leftFovL * near;
-		var rightR = rightFovR * near;
+		var leftL = near * leftFovL;
+		var rightR = near * rightFovR;
 		var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ];
 		var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ];
 		var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ];
 		var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ];
 
 		// Calculate the new camera's position offset from the
-		// left camera.
-		var zOffset = ipd / ( leftFovL - rightFovR );
-		var xOffset = zOffset * leftFovL;
+		// left camera. xOffset should be roughly half `ipd`.
+		var zOffset = ipd / ( - leftFovL + rightFovR );
+		var xOffset = zOffset * - leftFovL;
 
 		// TODO: Better way to apply this offset?
 		cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
 		camera.translateX( xOffset );
-		camera.translateZ( - zOffset * 2 );
+		camera.translateZ( zOffset );
 		camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
 		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 
@@ -36946,10 +36946,10 @@
 		this.zoom = 1;
 		this.view = null;
 
-		this.left = left;
-		this.right = right;
-		this.top = top;
-		this.bottom = bottom;
+		this.left = ( left !== undefined ) ? left : - 1;
+		this.right = ( right !== undefined ) ? right : 1;
+		this.top = ( top !== undefined ) ? top : 1;
+		this.bottom = ( bottom !== undefined ) ? bottom : - 1;
 
 		this.near = ( near !== undefined ) ? near : 0.1;
 		this.far = ( far !== undefined ) ? far : 2000;

文件差異過大導致無法顯示
+ 134 - 133
build/three.min.js


+ 11 - 11
build/three.module.js

@@ -21271,7 +21271,7 @@ var cameraLPos = 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.
  * And that near and far planes are identical for both cameras.
  */
@@ -21293,22 +21293,22 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
 
 	var leftFovL = ( projL[ 8 ] - 1 ) / projL[ 0 ];
 	var rightFovR = ( projR[ 8 ] + 1 ) / projR[ 0 ];
-	var leftL = leftFovL * near;
-	var rightR = rightFovR * near;
+	var leftL = near * leftFovL;
+	var rightR = near * rightFovR;
 	var topL = near * ( projL[ 9 ] + 1 ) / projL[ 5 ];
 	var topR = near * ( projR[ 9 ] + 1 ) / projR[ 5 ];
 	var bottomL = near * ( projL[ 9 ] - 1 ) / projL[ 5 ];
 	var bottomR = near * ( projR[ 9 ] - 1 ) / projR[ 5 ];
 
 	// Calculate the new camera's position offset from the
-	// left camera.
-	var zOffset = ipd / ( leftFovL - rightFovR );
-	var xOffset = zOffset * leftFovL;
+	// left camera. xOffset should be roughly half `ipd`.
+	var zOffset = ipd / ( - leftFovL + rightFovR );
+	var xOffset = zOffset * - leftFovL;
 
 	// TODO: Better way to apply this offset?
 	cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );
 	camera.translateX( xOffset );
-	camera.translateZ( - zOffset * 2 );
+	camera.translateZ( zOffset );
 	camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );
 	camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 
@@ -36940,10 +36940,10 @@ function OrthographicCamera( left, right, top, bottom, near, far ) {
 	this.zoom = 1;
 	this.view = null;
 
-	this.left = left;
-	this.right = right;
-	this.top = top;
-	this.bottom = bottom;
+	this.left = ( left !== undefined ) ? left : - 1;
+	this.right = ( right !== undefined ) ? right : 1;
+	this.top = ( top !== undefined ) ? top : 1;
+	this.bottom = ( bottom !== undefined ) ? bottom : - 1;
 
 	this.near = ( near !== undefined ) ? near : 0.1;
 	this.far = ( far !== undefined ) ? far : 2000;

部分文件因文件數量過多而無法顯示