Explorar o código

Points: export normals and colors (#25235)

WestLangley %!s(int64=2) %!d(string=hai) anos
pai
achega
35ea2e5dee
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      examples/jsm/exporters/PLYExporter.js

+ 7 - 0
examples/jsm/exporters/PLYExporter.js

@@ -97,8 +97,15 @@ class PLYExporter {
 				const geometry = mesh.geometry;
 
 				const vertices = geometry.getAttribute( 'position' );
+				const normals = geometry.getAttribute( 'normal' );
+				const colors = geometry.getAttribute( 'color' );
+
 				vertexCount += vertices.count;
 
+				if ( normals !== undefined ) includeNormals = true;
+
+				if ( colors !== undefined ) includeColors = true;
+
 				includeIndices = false;
 
 			}