I've been working on a simple OBJ Loader and I've managed to load up vertices and indices correctly (I think), but fail to get uvs (and perhaps normals) working well. At the moment, this is what I'm getting:
I've also made sure to triangulated my cube from Blender, so I'm getting the "/" in the faces portion of my .obj file. I also did some debugging and this cube should have 20 uv coordinates, which adds up to a 40 element array. But I'm only adding 16 elements in the array.
(40 spaces - 16 elements added = the 24 empty spaces).
I'm sure I'm doing something wrong and I can't wrap my head around it I copied the loader on to a JS Bin with the cube model as a string, so it's easy to see what I'm doing here: https://jsbin.com/kiqisog/edit?js,console
Would anybody have any idea what I'm doing wrong? It's only the loader, no WebGL or extra code, so don't worry. Thanks in advance, I know I'm messing up on something here!