public void computeBoundingBox() {
    // TODO: Compute the bounding box and store the result in
    // averagePosition, minBound, and maxBound.
	Point3 v1 = new Point3(center.x-radius,center.y+radius,center.z-radius); //front top left
    Point3 v2 = new Point3(center.x-radius,center.y-radius,center.z-radius); //front bottom left
    Point3 v3 = new Point3(center.x+radius,center.y+radius,center.z-radius); //front top right
    Point3 v4 = new Point3(center.x+radius,center.y-radius,center.z-radius); //front bottom right
    Point3 v5 = new Point3(center.x-radius,center.y+radius,center.z+radius); //back top left
    Point3 v6 = new Point3(center.x-radius,center.y-radius,center.z+radius); //back bottom left
    Point3 v7 = new Point3(center.x+radius,center.y+radius,center.z+radius); //back top right
    Point3 v8 = new Point3(center.x+radius,center.y-radius,center.z+radius); //back bottom right
    
    tMat.rightMultiply(v1);
    tMat.rightMultiply(v2);
    tMat.rightMultiply(v3);
    tMat.rightMultiply(v4);
    tMat.rightMultiply(v5);
    tMat.rightMultiply(v6);
    tMat.rightMultiply(v7);
    tMat.rightMultiply(v8);
    
    Point3[] vertices = new Point3[8];
    vertices[0] = v1;
    vertices[1] = v2;
    vertices[2] = v3;
    vertices[3] = v4;
    vertices[4] = v5;
    vertices[5] = v6;
    vertices[6] = v7;
    vertices[7] = v8;
    
    double xMin = v1.x;
    double xMax = v1.x;
    double yMin = v1.y;
    double yMax = v1.y;
    double zMin = v1.z;
    double zMax = v1.z;
    for (Point3 p: vertices) {
    	if (p.x<xMin) {
    		xMin = p.x;
    	}
    	if (p.x>xMax) {
    		xMax = p.x;
    	}
    	if (p.y<yMin) {
    		yMin = p.y;
    	}
    	if (p.y>yMax) {
    		yMax = p.y;
    	}
    	if (p.z<zMin) {
    		zMin = p.z;
    	}
    	if (p.z>zMax) {
    		zMax = p.z;
    	}
    }
    minBound = new Point3();
    minBound.set(xMin, yMin, zMin);
    maxBound = new Point3();
    maxBound.set(xMax, yMax, zMax);
    averagePosition =  new Point3();
    averagePosition.set((xMin+xMax)/2, (yMin+yMax)/2, (zMin+zMax)/2);
    
  }