//<pre>

public class Plane extends Shape3D {


	public  Plane(int n) {
		
		super();
		
		double newVertices[][] = new double[(n+1)*(n+1)][6];
		int newFaces[][] = new int[n*n][4];

		int lastIndex = 0;
		for (int i = 0; i < n + 1; i++) {
			for (int j = 0; j < n + 1; j++) {
			
				newVertices[lastIndex  ][0] = ((i / (float)n) * 2) - 1;
				newVertices[lastIndex  ][1] = ((j / (float)n) * 2) - 1;
				newVertices[lastIndex++][2] = 0.0;
				
			}
		}

		lastIndex = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				
				newFaces[lastIndex  ][0] = (i*(n+1)) + j;
				newFaces[lastIndex  ][1] = (i*(n+1)) + j + (n+1);
				newFaces[lastIndex  ][2] = (i*(n+1)) + j + (n+1) + 1;
				newFaces[lastIndex++][3] = (i*(n+1)) + j         + 1;
				
				
			}
		}

		super.vertices = newVertices;
		super.faces = newFaces;
	
		transformedVertices = new double[vertices.length][vertices[0].length];

		//this.print();
		
	}
	
	public void animate() {
	}
}