Browse Source

Merge pull request #7218 from tschw/FixIndexedRender

Showstoppers
Mr.doob 10 years ago
parent
commit
3d5b5d5172
2 changed files with 3 additions and 5 deletions
  1. 2 0
      src/core/BufferGeometry.js
  2. 1 5
      src/renderers/WebGLRenderer.js

+ 2 - 0
src/core/BufferGeometry.js

@@ -66,6 +66,8 @@ THREE.BufferGeometry.prototype = {
 			console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
 			this.setIndex( attribute );
 
+			return;
+
 		}
 
 		this.attributes[ name ] = attribute;

+ 1 - 5
src/renderers/WebGLRenderer.js

@@ -804,11 +804,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			if ( index !== null ) {
 
-				count = index.count;
-
-			} else if ( position instanceof THREE.InterleavedBufferAttribute ) {
-
-				count = position.data.array.length / 3;
+				count = index.array.length;
 
 			} else {