浏览代码

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

Mugen87 6 年之前
父节点
当前提交
ca0bf1e97b
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 = [];