From 554909a156486434a15bfcd6c3b1206e9686d55c Mon Sep 17 00:00:00 2001 From: Jeff Nusz Date: Tue, 24 Jan 2017 16:54:03 -0800 Subject: [PATCH] check if texCoords defined before looping through all coordinates --- javascript/example/DRACOLoader.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/javascript/example/DRACOLoader.js b/javascript/example/DRACOLoader.js index 0cbbbe3..0f0a0b9 100644 --- a/javascript/example/DRACOLoader.js +++ b/javascript/example/DRACOLoader.js @@ -175,14 +175,14 @@ THREE.DRACOLoader.prototype = { } } - for (let i = 0; i < numTextureCoordinates; i += 2) { - // Add texture coordinates. - if (texCoordAttId != -1) { - geometryBuffer.uvs.push( - textCoordAttributeData.GetValue(i), - textCoordAttributeData.GetValue(i + 1)); - } + // Add texture coordinates. + if (texCoordAttId != -1) { + for (let i = 0; i < numTextureCoordinates; i += 2) { + geometryBuffer.uvs.push( + textCoordAttributeData.GetValue(i), + textCoordAttributeData.GetValue(i + 1)); } + } DracoModule.destroy(posAttributeData); if (colorAttId != -1)