Browse Source

VRMLLoader: Only create vertex color data when "colorIndex" is defined.

Mugen87 6 years ago
parent
commit
ca0bf1e97b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/js/loaders/VRMLLoader.js

+ 1 - 1
examples/js/loaders/VRMLLoader.js

@@ -988,7 +988,7 @@ THREE.VRMLLoader.prototype = {
 
 							var positionIndexes = data.coordIndex ? triangulateIndexArray( data.coordIndex, data.ccw ) : [];
 							var normalIndexes = data.normalIndex ? triangulateIndexArray( data.normalIndex, data.ccw ) : positionIndexes;
-							var colorIndexes = data.colorIndex ? triangulateIndexArray( data.colorIndex, data.ccw, data.colorPerVertex ) : positionIndexes;
+							var colorIndexes = data.colorIndex ? triangulateIndexArray( data.colorIndex, data.ccw, data.colorPerVertex ) : [];
 							var uvIndexes = data.texCoordIndex ? triangulateIndexArray( data.texCoordIndex, data.ccw ) : positionIndexes;
 
 							var newIndexes = [];