Vector3f[] normal = new Vector3f[vertex.length];   normal[0] = vertex[size].cross(vertex[1]).normalize(); normal[normal.length - 1] = vertex[normal.length - 1 - size].cross( vertex[normal.length - 2]).normalize();  for (int i = 1; i < normal.length - 1; i++) { if (i % ((size * (i / size + 1)) - 1) == 0) {  normal[i] = new Vector3f(); } else if (i >= size * (size - 1)) {  normal[i] = new Vector3f(0,1,0); } else {  normal[i] = vertex[i + size].cross(vertex[i + 1]).normalize();
Vector3f[] normal = new Vector3f[vertex.length];  int normalIndex = 0; for (int row = 0; row < size; row++) { for (int col = 0; col < size; col++) { if (row == size - 1) { if (col == size - 1) {  normal[normalIndex] = vertex[normalIndex - size].subtract(vertex[normalIndex]).cross(vertex[normalIndex - 1].subtract(vertex[normalIndex])).normalize(); } else {  normal[normalIndex] = vertex[normalIndex + 1].subtract(vertex[normalIndex]).cross(vertex[normalIndex - size].subtract(vertex[normalIndex])).normalize();
    private void buildNormals() {        Vector3f[] normal = new Vector3f[vertex.length];        //get the first and last normals taken care of.        normal[0] = vertex[size].cross(vertex[1]).normalize();        normal[normal.length - 1] = vertex[normal.length - 1 - size].cross(                vertex[normal.length - 2]).normalize();        for (int i = 1; i < normal.length - 1; i++) {            if (i % ((size * (i / size + 1)) - 1) == 0) {                //right hand normal                normal[i] = new Vector3f();            } else if (i >= size * (size - 1)) {                //bottom row                normal[i] = new Vector3f(0,1,0);            } else {                //interior                normal[i] = vertex[i + size].cross(vertex[i + 1]).normalize();            }        }        setNormals(normal);    }