Browse Source

Merge pull request #15879 from Mugen87/dev27

VRMLLoader: Only create vertex color data when "colorIndex" is defined.
Mr.doob 6 years ago
parent
commit
19e633ec55
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 = [];