What am I missing here (triangle list)

I'm wanting to create a simple  model in code for experimentation so I'm looking at the box class to see how it does it.  After some math to calculate where the 8 corners are we get this:


   private void setVertexData() {
        TriangleBatch batch = getBatch(0);
        batch.setVertexBuffer(BufferUtils.createVector3Buffer(batch.getVertexBuffer(), 24));
       batch.setVertexCount(24);
      Vector3f[] vert = computeVertices(); // returns 8

      //Back
      batch.getVertexBuffer().put(vert[0].x).put(vert[0].y).put(vert[0].z);
      batch.getVertexBuffer().put(vert[1].x).put(vert[1].y).put(vert[1].z);
      batch.getVertexBuffer().put(vert[2].x).put(vert[2].y).put(vert[2].z);
      batch.getVertexBuffer().put(vert[3].x).put(vert[3].y).put(vert[3].z);

      //Right ...



My confusion comes in as to why Back only has 4 points.  Shouldn't the back consist of 2 triangles and hence 6 points, 3 points for each triangle?  That's how I've made boxes in other engines, what is different here?  What am I missing?

I cannot find that in my source, where is it?



Remember that jME often uses indexed triangles. So it can reuse vertices for multiple triangles.

This is actually in the engine source itself.  I think I figured out what it is.  TriangleBatch is not a triangle list, but some helper function/Class to create the triangle list.  As to where this was quoted from:



jme/jme/src/com/jme/scene/shape/box.java