Browse Source

Editor: Fix triangle counting for indexed buffer geometry.

Don McCurdy 7 years ago
parent
commit
53d41043fc
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 ) {
 
+						vertices += geometry.attributes.position.count;
+
 						if ( geometry.index !== null ) {
 
-							vertices += geometry.index.count * 3;
-							triangles += geometry.index.count;
+							triangles += geometry.index.count / 3;
 
 						} else {
 
-							vertices += geometry.attributes.position.count;
 							triangles += geometry.attributes.position.count / 3;
 
 						}