package graphics; public class Sphere extends Shape { public Sphere() { super(25, 25); } public Sphere(int newM, int newN) { super(newM, newN); } //convert u/v pair to xyz point protected double[] calculatePoint(double u, double v) { //System.err.println("calculatePoint("+u+", "+v+")"); //point-normal-texture double[] vertex = {0,0,0, 0,0,0, 0,0}; double theta = 2 * Math.PI * u; double phi = Math.PI * v - Math.PI/2; vertex[0] = Math.cos(theta) * Math.cos(phi); //x vertex[1] = Math.sin(theta) * Math.cos(phi); //y vertex[2] = Math.sin(phi); //z //ignore normal for now vertex[6] = u; vertex[7] = v; return vertex; } //gotta overwrite this b/c of casting issues :-/ public Object clone() { Sphere newSphere = new Sphere(M, N); for (int i=0; i