浏览代码

Editor: Fix triangle counting for indexed buffer geometry.

Don McCurdy 7 年之前
父节点
当前提交
53d41043fc
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      editor/js/Viewport.Info.js

+ 3 - 3
editor/js/Viewport.Info.js

@@ -53,14 +53,14 @@ Viewport.Info = function ( editor ) {
 
 
 					} else if ( geometry instanceof THREE.BufferGeometry ) {
 					} else if ( geometry instanceof THREE.BufferGeometry ) {
 
 
+						vertices += geometry.attributes.position.count;
+
 						if ( geometry.index !== null ) {
 						if ( geometry.index !== null ) {
 
 
-							vertices += geometry.index.count * 3;
-							triangles += geometry.index.count;
+							triangles += geometry.index.count / 3;
 
 
 						} else {
 						} else {
 
 
-							vertices += geometry.attributes.position.count;
 							triangles += geometry.attributes.position.count / 3;
 							triangles += geometry.attributes.position.count / 3;
 
 
 						}
 						}