File tree Expand file tree Collapse file tree 2 files changed +61
-23
lines changed
Expand file tree Collapse file tree 2 files changed +61
-23
lines changed Original file line number Diff line number Diff line change 1254612546
1254712547 } else {
1254812548
12549+ this.computeFaceNormals();
12550+
1254912551 for ( f = 0, fl = this.faces.length; f < fl; f ++ ) {
1255012552
1255112553 face = this.faces[ f ];
1259412596
1259512597 },
1259612598
12599+ computeFlatVertexNormals: function () {
12600+
12601+ var f, fl, face;
12602+
12603+ this.computeFaceNormals();
12604+
12605+ for ( f = 0, fl = this.faces.length; f < fl; f ++ ) {
12606+
12607+ face = this.faces[ f ];
12608+
12609+ var vertexNormals = face.vertexNormals;
12610+
12611+ if ( vertexNormals.length === 3 ) {
12612+
12613+ vertexNormals[ 0 ].copy( face.normal );
12614+ vertexNormals[ 1 ].copy( face.normal );
12615+ vertexNormals[ 2 ].copy( face.normal );
12616+
12617+ } else {
12618+
12619+ vertexNormals[ 0 ] = face.normal.clone();
12620+ vertexNormals[ 1 ] = face.normal.clone();
12621+ vertexNormals[ 2 ] = face.normal.clone();
12622+
12623+ }
12624+
12625+ }
12626+
12627+ if ( this.faces.length > 0 ) {
12628+
12629+ this.normalsNeedUpdate = true;
12630+
12631+ }
12632+
12633+ },
12634+
1259712635 computeMorphNormals: function () {
1259812636
1259912637 var i, il, f, fl, face;
You can’t perform that action at this time.
0 commit comments