protected void endShapeFill() {
    switch (shape) {
    case TRIANGLE_FAN:
    {
      int stop = shapeLast - 1;
      for (int i = shapeFirst + 1; i < stop; i++) {
        addTriangle(shapeFirst, i, i+1);
      }
    }
    break;

    case TRIANGLES:
    {
      int stop = shapeLast - 2;
      for (int i = shapeFirst; i < stop; i += 3) {
        // have to switch between clockwise/counter-clockwise
        // otherwise the feller is backwards and renderer won't draw
        if ((i % 2) == 0) {
          addTriangle(i, i+2, i+1);
        } else {
          addTriangle(i, i+1, i+2);
        }
      }
    }
    break;

    case TRIANGLE_STRIP:
    {
      int stop = shapeLast - 2;
      for (int i = shapeFirst; i < stop; i++) {
        // have to switch between clockwise/counter-clockwise
        // otherwise the feller is backwards and renderer won't draw
        if ((i % 2) == 0) {
          addTriangle(i, i+2, i+1);
        } else {
          addTriangle(i, i+1, i+2);
        }
      }
    }
    break;

    case QUADS:
    {
      int stop = vertexCount-3;
      for (int i = shapeFirst; i < stop; i += 4) {
        // first triangle
        addTriangle(i, i+1, i+2);
        // second triangle
        addTriangle(i, i+2, i+3);
      }
    }
    break;

    case QUAD_STRIP:
    {
      int stop = vertexCount-3;
      for (int i = shapeFirst; i < stop; i += 2) {
        // first triangle
        addTriangle(i+0, i+2, i+1);
        // second triangle
        addTriangle(i+2, i+3, i+1);
      }
    }
    break;

    case POLYGON:
    {
      addPolygonTriangles();
    }
    break;
    }
  }