Browse Source

Testing viewports

zz85 14 years ago
parent
commit
07442382f6
2 changed files with 32 additions and 10 deletions
  1. 1 1
      gui/js/Code.js
  2. 31 9
      gui/js/UI.Viewports.js

+ 1 - 1
gui/js/Code.js

@@ -29,7 +29,7 @@ var Code = function () {
 			temp = temp.firstChild.nodeValue;
 			temp = temp.firstChild.nodeValue;
 			temp = temp.replace("js/Three.js", "../build/Three.js");
 			temp = temp.replace("js/Three.js", "../build/Three.js");
 			temp = temp.replace("js/RequestAnimationFrame.js", "../examples/js/RequestAnimationFrame.js");
 			temp = temp.replace("js/RequestAnimationFrame.js", "../examples/js/RequestAnimationFrame.js");
-			aaa = temp;
+
 			console.log('test', temp);
 			console.log('test', temp);
 			
 			
 			var opener = window.open('','myconsole',
 			var opener = window.open('','myconsole',

+ 31 - 9
gui/js/UI.Viewports.js

@@ -21,16 +21,38 @@ UI.Viewports = function () {
 		{ x: null, y: null, width: null, height: null, camera: null }
 		{ x: null, y: null, width: null, height: null, camera: null }
 	];
 	];
 
 
-	_views[ 0 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // top
-	_views[ 0 ].camera.position.y = 1000;
-	_views[ 0 ].camera.rotation.x = - Math.PI / 2;
 
 
-	_views[ 1 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // front
-	_views[ 1 ].camera.position.z = 1000;
-
-	_views[ 2 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // left
-	_views[ 2 ].camera.position.x = - 1000;
-	_views[ 2 ].camera.rotation.y = - Math.PI / 2;
+	//_views[ 0 ].camera = new THREE.PerspectiveCamera( 50, 1, 1, 5000 ); // front
+	_views[ 0 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // front
+	_views[ 0 ].camera.position.z = 1000;
+
+	//_views[ 2 ].camera = new THREE.PerspectiveCamera( 50, 1, 1, 5000 ); // top
+	_views[ 2 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // top
+	_views[ 2 ].camera.position.y = 1000;
+	_views[ 2 ].camera.rotation.x = - Math.PI / 2;
+
+ 	//_views[ 3 ].camera = new THREE.PerspectiveCamera( 50, 1, 1, 5000 ); // left
+	_views[ 1 ].camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, - 2000, 2000 ); // left
+	_views[ 1 ].camera.position.x = - 1000;
+	_views[ 1 ].camera.rotation.y = -Math.PI / 2;
+	
+	// var toLeft = function() {
+	// 	this.rotation.x = 0;
+	// 	this.rotation.y = - Math.PI / 2;
+	// 	this.rotation.z = 0;
+	// }
+	// 
+	// var toRight = function() {
+	// 	this.rotation.x = 0;
+	// 	this.rotation.y = Math.PI / 2;
+	// 	this.rotation.z = 0;
+	// }
+	// 
+	// var toTop = function() {
+	// 	this.rotation.x = - Math.PI / 2;
+	// 	this.rotation.y = 0;
+	// 	this.rotation.z = 0;
+	// }
 
 
 	_views[ 3 ].camera = new THREE.PerspectiveCamera( 50, 1, 1, 5000 ); // perspective
 	_views[ 3 ].camera = new THREE.PerspectiveCamera( 50, 1, 1, 5000 ); // perspective
 	_views[ 3 ].camera.position.x = 1000;
 	_views[ 3 ].camera.position.x = 1000;