Browse Source

Merge pull request #13143 from donmccurdy/editor-tri-count

Editor: Fix triangle counting for indexed buffer geometry.
Mr.doob 7 years ago
parent
commit
59a211d8ab
1 changed files with 3 additions and 3 deletions
  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;
 
 
 						}
 						}