webgl-obj-loader
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "webgl-obj-loader", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A simple OBJ model loader to help facilitate the learning of WebGL", | ||
@@ -5,0 +5,0 @@ "main": "webgl-obj-loader.js", |
@@ -183,12 +183,14 @@ (function (undefined) { | ||
// vertex position | ||
unpacked.verts.push(verts[(vertex[0] - 1) * 3 + 0]); | ||
unpacked.verts.push(verts[(vertex[0] - 1) * 3 + 1]); | ||
unpacked.verts.push(verts[(vertex[0] - 1) * 3 + 2]); | ||
unpacked.verts.push(+verts[(vertex[0] - 1) * 3 + 0]); | ||
unpacked.verts.push(+verts[(vertex[0] - 1) * 3 + 1]); | ||
unpacked.verts.push(+verts[(vertex[0] - 1) * 3 + 2]); | ||
// vertex textures | ||
unpacked.textures.push(textures[(vertex[1] - 1) * 2 + 0]); | ||
unpacked.textures.push(textures[(vertex[1] - 1) * 2 + 1]); | ||
if (textures.length) { | ||
unpacked.textures.push(+textures[(vertex[1] - 1) * 2 + 0]); | ||
unpacked.textures.push(+textures[(vertex[1] - 1) * 2 + 1]); | ||
} | ||
// vertex normals | ||
unpacked.norms.push(vertNormals[(vertex[2] - 1) * 3 + 0]); | ||
unpacked.norms.push(vertNormals[(vertex[2] - 1) * 3 + 1]); | ||
unpacked.norms.push(vertNormals[(vertex[2] - 1) * 3 + 2]); | ||
unpacked.norms.push(+vertNormals[(vertex[2] - 1) * 3 + 0]); | ||
unpacked.norms.push(+vertNormals[(vertex[2] - 1) * 3 + 1]); | ||
unpacked.norms.push(+vertNormals[(vertex[2] - 1) * 3 + 2]); | ||
// add the newly created vertex to the list of indices | ||
@@ -195,0 +197,0 @@ unpacked.hashindices[elements[j]] = unpacked.index; |
231220
3472