makc 8 years ago
parent
commit
94cb80c12c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      examples/js/loaders/PLYLoader.js

+ 3 - 1
examples/js/loaders/PLYLoader.js

@@ -312,7 +312,9 @@ THREE.PLYLoader.prototype = {
 
 			// mandatory buffer data
 
-			geometry.setIndex( new ( buffer.indices.length > 65535 ? THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute )( buffer.indices, 1 ) );
+			if ( buffer.indices.length > 0 ) {
+				geometry.setIndex( new ( buffer.indices.length > 65535 ? THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute )( buffer.indices, 1 ) );
+			}
 			geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( buffer.vertices, 3 ) );
 
 			// optional buffer data