Browse Source

Now we just need to make sure geometry.computeCentroids() is called at the end of creating/modifying the geometry, otherwise things break...

Mr.doob 14 years ago
parent
commit
8eb356db40
2 changed files with 4 additions and 0 deletions
  1. 3 0
      examples/geometry_terrain.html
  2. 1 0
      examples/test.html

+ 3 - 0
examples/geometry_terrain.html

@@ -92,6 +92,9 @@
 
 				}
 
+				plane.computeNormals();
+				plane.computeCentroids();
+
 				mesh = new THREE.Mesh( plane, material );
 				mesh.rotation.x = -90 * Math.PI / 180;
 				mesh.overdraw = true;

+ 1 - 0
examples/test.html

@@ -170,6 +170,7 @@
 				}
 
 				geometry.computeNormals();
+				geometry.computeCentroids();
 
 				mesh = new THREE.Mesh( geometry, [ new THREE.MeshFaceMaterial(), new THREE.MeshColorStrokeMaterial( 0xff0000, 0.5, 10 ) ] );
 				mesh.doubleSided = true;