소스 검색

Geometry: compute area-weighted normals by default

WestLangley 9 년 전
부모
커밋
12ea602070
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/core/Geometry.js

+ 8 - 0
src/core/Geometry.js

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