protected final void addTriangleWithClip(int a, int b, int c) {
    boolean aClipped = false;
    boolean bClipped = false;
    int clippedCount = 0;

    cameraNear = -8;
    if (vertices[a][VZ] > cameraNear) {
      aClipped = true;
      clippedCount++;
    }
    if (vertices[b][VZ] > cameraNear) {
      bClipped = true;
      clippedCount++;
    }
    if (vertices[c][VZ] > cameraNear) {
      //cClipped = true;
      clippedCount++;
    }
    if (clippedCount == 0) {
      addTriangleWithoutClip(a, b, c);

    } else if (clippedCount == 3) {
      // In this case there is only one visible point.            |/|
      // So we'll have to make two new points on the clip line   <| |
      // and add that triangle instead.                           |\|

    } else if (clippedCount == 2) {
      //System.out.println("Clipped two");

      int ca, cb, cc, cd, ce;
      if (!aClipped) {
        ca = a;
        cb = b;
        cc = c;
      }
      else if (!bClipped) {
        ca = b;
        cb = a;
        cc = c;
      }
      else { //if (!cClipped) {
        ca = c;
        cb = b;
        cc = a;
      }

      cd = interpolateClipVertex(ca, cb);
      ce = interpolateClipVertex(ca, cc);
      addTriangleWithoutClip(ca, cd, ce);

    } else { // (clippedCount == 1) {
      //                                                          . |
      // In this case there are two visible points.               |\|
      // So we'll have to make two new points on the clip line    | |>
      // and then add two new triangles.                          |/|
      //                                                          . |
      //System.out.println("Clipped one");
      int ca, cb, cc, cd, ce;
      if (aClipped) {
        //System.out.println("aClipped");
        ca = c;
        cb = b;
        cc = a;
      }
      else if (bClipped) {
        //System.out.println("bClipped");
        ca = a;
        cb = c;
        cc = b;
      }