Browse Source

Geometry: compute area-weighted normals by default

WestLangley 9 years ago
parent
commit
12ea602070
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/core/Geometry.js

+ 8 - 0
src/core/Geometry.js

@@ -399,6 +399,8 @@ THREE.Geometry.prototype = {
 
 	computeVertexNormals: function ( areaWeighted ) {
 
+		if ( areaWeighted === undefined ) areaWeighted = true;
+
 		var v, vl, f, fl, face, vertices;
 
 		vertices = new Array( this.vertices.length );
@@ -477,6 +479,12 @@ THREE.Geometry.prototype = {
 
 		}
 
+		if ( this.faces.length > 0 ) {
+
+			this.normalsNeedUpdate = true;
+
+		}
+
 	},
 
 	computeMorphNormals: function () {