diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 6e3d520f3f3ccde13e81dac4bd196bd2e39dcc99..ba67abc171f5684c67ce1955ad1a9bafe1815499 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -1008,10 +1008,9 @@ THREE.GLTFExporter.prototype = { if ( geometry.index === null && options.forceIndices ) { - var numFaces = geometry.attributes.position.count; - var indices = new Uint32Array( numFaces ); + var indices = new Uint32Array( geometry.attributes.position.count ); - for ( var i = 0; i < numFaces; i ++ ) { + for ( var i = 0, il = indices.length; i < il; i ++ ) { indices[ i ] = i;