Ver código fonte

PLYLoader: Add vertex colors back. (#26214)

Michael Herzog 2 anos atrás
pai
commit
a72d668fe8
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      examples/jsm/loaders/PLYLoader.js

+ 6 - 0
examples/jsm/loaders/PLYLoader.js

@@ -408,6 +408,12 @@ class PLYLoader extends Loader {
 
 
 			}
 			}
 
 
+			if ( buffer.colors.length > 0 ) {
+
+				geometry.setAttribute( 'color', new Float32BufferAttribute( buffer.colors, 3 ) );
+
+			}
+
 			if ( buffer.faceVertexUvs.length > 0 || buffer.faceVertexColors.length > 0 ) {
 			if ( buffer.faceVertexUvs.length > 0 || buffer.faceVertexColors.length > 0 ) {
 
 
 				geometry = geometry.toNonIndexed();
 				geometry = geometry.toNonIndexed();