Skip to content

Commit f06ba34

Browse files
authored
Merge pull request #17994 from WestLangley/dev_ply_exporter
PLYExporter: normalize after applying normalMatrix
2 parents 447e8e7 + 18f91f0 commit f06ba34

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/js/exporters/PLYExporter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ THREE.PLYExporter.prototype = {
276276
vertex.y = normals.getY( i );
277277
vertex.z = normals.getZ( i );
278278

279-
vertex.applyMatrix3( normalMatrixWorld );
279+
vertex.applyMatrix3( normalMatrixWorld ).normalize();
280280

281281
output.setFloat32( vOffset, vertex.x );
282282
vOffset += 4;
@@ -452,7 +452,7 @@ THREE.PLYExporter.prototype = {
452452
vertex.y = normals.getY( i );
453453
vertex.z = normals.getZ( i );
454454

455-
vertex.applyMatrix3( normalMatrixWorld );
455+
vertex.applyMatrix3( normalMatrixWorld ).normalize();
456456

457457
line += ' ' +
458458
vertex.x + ' ' +

examples/jsm/exporters/PLYExporter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ PLYExporter.prototype = {
282282
vertex.y = normals.getY( i );
283283
vertex.z = normals.getZ( i );
284284

285-
vertex.applyMatrix3( normalMatrixWorld );
285+
vertex.applyMatrix3( normalMatrixWorld ).normalize();
286286

287287
output.setFloat32( vOffset, vertex.x );
288288
vOffset += 4;
@@ -458,7 +458,7 @@ PLYExporter.prototype = {
458458
vertex.y = normals.getY( i );
459459
vertex.z = normals.getZ( i );
460460

461-
vertex.applyMatrix3( normalMatrixWorld );
461+
vertex.applyMatrix3( normalMatrixWorld ).normalize();
462462

463463
line += ' ' +
464464
vertex.x + ' ' +

0 commit comments

Comments
 (0)