Browse Source

* three.js: Fixed terrain example (was still using Scene.add())

Mr.doob 14 years ago
parent
commit
8ee8c9baf9
3 changed files with 3 additions and 4 deletions
  1. 0 1
      examples/camera_free.html
  2. 1 1
      examples/geometry_terrain.html
  3. 2 2
      src/core/Matrix4.js

+ 0 - 1
examples/camera_free.html

@@ -101,7 +101,6 @@
 			var debugContext;
 
 			init();
-			loop();
 			setInterval(loop, 1000/60);
 
 			function init() {

+ 1 - 1
examples/geometry_terrain.html

@@ -95,7 +95,7 @@
 				mesh = new THREE.Mesh( plane, material );
 				mesh.rotation.x = -90 * Math.PI / 180;
 				mesh.overdraw = true;
-				scene.add(mesh);
+				scene.addObject(mesh);
 
 				renderer = new THREE.CanvasRenderer();
 				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );

+ 2 - 2
src/core/Matrix4.js

@@ -435,10 +435,10 @@ THREE.Matrix4.makeOrtho = function( left, right, top, bottom, near, far ) {
 
 	m = new THREE.Matrix4();
 	w = right - left;
-	h = top - bottom; // bottom - top
+	h = top - bottom;
 	p = far - near;
 	x = ( right + left ) / w;
-	y = ( top + bottom ) / h; // ( bottom + top ) / h
+	y = ( top + bottom ) / h;
 	z = ( far + near ) / p;
 
 	m.n11 = 2 / w; m.n12 = 0;     m.n13 = 0;      m.n14 = -x;