Browse Source

Determine BufferGeometry attribute numItems automatically.

Tapio Vierros 12 years ago
parent
commit
9ba0ec41da
2 changed files with 12 additions and 0 deletions
  1. 6 0
      src/renderers/WebGLRenderer.js
  2. 6 0
      src/renderers/WebGLRenderer2.js

+ 6 - 0
src/renderers/WebGLRenderer.js

@@ -1150,6 +1150,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			attribute = geometry.attributes[ a ];
 
+			if ( attribute.numItems === undefined ) {
+
+				attribute.numItems = attribute.array.length;
+
+			}
+
 			attribute.buffer = _gl.createBuffer();
 
 			_gl.bindBuffer( type, attribute.buffer );

+ 6 - 0
src/renderers/WebGLRenderer2.js

@@ -462,6 +462,12 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			attribute = geometry.attributes[ a ];
 
+			if ( attribute.numItems === undefined ) {
+
+				attribute.numItems = attribute.array.length;
+
+			}
+
 			attribute.buffer = renderer.createBuffer();
 
 			if ( a === "index" ) {