title: Converting OBJ file to VBO using JavaScript
body: <p>I am trying to convert an OBJ file to data that I can pass to a VBO, but I only managed to load simple models that do not have a lot of vertices. For now I am trying to load a model that has vertices and normals.</p>
  
  <p>This is what I have: <a href="http://undefined.free.bg/Wavefront%20to%20JSON/" rel="nofollow">http://undefined.free.bg/Wavefront%20to%20JSON/</a></p>
  
  <p>This reads the entire file and stores it in an array, then stores the lines with "v" in front of them in an array of vertices and the ones with "vn" in front in an array of normals. I use the faces to export them, duplicating all of the vertices (for example if blender exports a cube with 8 vertices, my output converts this to 36 vertices forming the triangles and no indices at all, since blender exports a normal per face and not a normal per vertex).</p>
  
  <p>The problem is that the file gets too big and the for loop crashes if I load the blender monkey head, but if I load simple geometry like a cube or icosphere everything turns out okay. </p>
  
  <p>Here is the code that is converting the OBJ file: <a href="http://undefined.free.bg/Wavefront%20to%20JSON/javascript/convert.js" rel="nofollow">http://undefined.free.bg/Wavefront%20to%20JSON/javascript/convert.js</a> .</p>
  
  <p>I tried to optimize the loop by waiting 100ms each time the loop loops for example 500 times, but it just gives the converter a few additional seconds before it crashes.</p>