title: threejs json loader mixed faces and vertices
body: <p>I am trying to write an geometry translator from one CAD package to ThreeJS through JSON.  I can use the JSONLoader to bring in the geometry I am writing to a js file, but it seems the vertex index do not match the original faces.  Let me show you:
  <a href="https://i.imgur.com/oVCUynr.png" rel="nofollow noreferrer">http://i.imgur.com/oVCUynr.png</a></p>
  
  <p>This is a simple cube on the left.  I've added some number tags so you can see the face index as well as the vertex index of the underlying information which forms the cube.  On the right, is how I see it in the ThreeJS Editor.</p>
  
  <p>The editor verifies the correct number of faces and vertices, but it seems the faces are not composed of the correct vertices.</p>
  
  <p>Here is a link to the json file:<a href="https://gist.github.com/fraguada/8ea243744961d72d61de" rel="nofollow noreferrer">https://gist.github.com/fraguada/8ea243744961d72d61de</a></p>
  
  <p>Essentially what I am doing is creating a list of vertex coordinates</p>
  
  <pre><code>vertex[0].x,vertex[0].y,vertex[0].z, ...vertex[n].x,vertex[n].y,vertex[n].z....
  </code></pre>
  
  <p>similar for normals and faces</p>
  
  <pre><code>faces[0].a,faces[0].b,faces[0].c,...faces[n].a,faces[n].b,faces[n].c,...
  </code></pre>
  
  <p>Am I not understanding the manner in which to construct the ThreeJS?  I've referred to the JSON format for ThreeJS but I am obviously not exporting the data correctly.  Any pointers for what I may be doing wrong would be greatly appreciated.  With more complex meshes, there are even faces missing.</p>