private Vector3f[] calculatefacetNorms(GeometryInfo gi)
  {
    Point3f coordinates[] = gi.getCoordinates();
    Vector3f[] facetNorms = new Vector3f[coordInds.length / 3];
    Vector3f a = new Vector3f();
    Vector3f b = new Vector3f();
    if ((DEBUG & 1) != 0) System.out.println("Facet normals:");

    if (gi.getOldPrim() != GeometryInfo.QUAD_ARRAY) {
      for (int t = 0 ; t < coordInds.length ; t += 3) {
	a.sub(coordinates[coordInds[t + 2]], coordinates[coordInds[t + 1]]);
	b.sub(coordinates[coordInds[t + 0]], coordinates[coordInds[t + 1]]);
	facetNorms[t / 3] = new Vector3f();
	facetNorms[t / 3].cross(a, b);
	facetNorms[t / 3].normalize();

	if (Float.isNaN(facetNorms[t / 3].x)) {
	  // Normal isn't valid
	  facetNorms[t / 3].x = 1.0f;
	  facetNorms[t / 3].y = facetNorms[t / 3].z = 0.0f;
	}
	if ((DEBUG & 1) != 0) {
	  System.out.println("  " + (t/3) + " " + facetNorms[t / 3]);
	}
      }
    } else {
      // For quads, the facet normal of both triangles is the cross
      // product of the two vectors that make an 'X' across the quad.
      for (int t = 0 ; t < coordInds.length ; t += 6) {
	a.sub(coordinates[coordInds[t + 2]], coordinates[coordInds[t + 0]]);
	b.sub(coordinates[coordInds[t + 5]], coordinates[coordInds[t + 1]]);
	facetNorms[t / 3] = new Vector3f();
	facetNorms[t / 3].cross(a, b);
	facetNorms[t / 3].normalize();

	if (Float.isNaN(facetNorms[t / 3].x)) {
	  // Normal isn't valid
	  facetNorms[t / 3].x = 1.0f;
	  facetNorms[t / 3].y = facetNorms[t / 3].z = 0.0f;
	}

        // Second triangle of quad
	facetNorms[t / 3 + 1] = new Vector3f(facetNorms[t / 3]);

	if ((DEBUG & 1) != 0) {
	  System.out.println("  " + (t/3) + "&" + (t/3 + 1) + " " +
	    facetNorms[t / 3]);
	}
      }
    }
    return facetNorms;
  } // End of calculatefacetNorms