public void computeBoundingBox() {
    // TODO: Compute the bounding box and store the result in
    // averagePosition, minBound, and maxBound.
    // Hint: The bounding box may be transformed by a transformation matrix.
	
    Point3 p1,p2,p3,p4,p5,p6,p7,p8;
	p1 = new Point3(center.x-radius,center.y-radius,center.z-height);
	p2 = new Point3(center.x-radius,center.y-radius,center.z+height);
	p3 = new Point3(center.x-radius,center.y+radius,center.z-height);
	p4 = new Point3(center.x+radius,center.y-radius,center.z-height);
	p5 = new Point3(center.x-radius,center.y+radius,center.z+height);
	p6 = new Point3(center.x+radius,center.y-radius,center.z+height);
	p7 = new Point3(center.x+radius,center.y+radius,center.z-height);
	p8 = new Point3(center.x+radius,center.y+radius,center.z+height);
	
	tMat.rightMultiply(p1);
	tMat.rightMultiply(p2);
	tMat.rightMultiply(p3);
	tMat.rightMultiply(p4);
	tMat.rightMultiply(p5);
	tMat.rightMultiply(p6);
	tMat.rightMultiply(p7);
	tMat.rightMultiply(p8);
	
	double minX = p1.x;
	double minY = p1.y;
	double minZ = p1.z;
	double maxX = p8.x;
	double maxY = p8.y;
	double maxZ = p8.z;
	
	Point3[] points = new Point3[8];
	points[0] = p1;
	points[1] = p2;
	points[2] = p3;
	points[3] = p4;
	points[4] = p5;
	points[5] = p6;
	points[6] = p7;
	points[7] = p8;
	
	for (int i=0;i<8;i++){
		if (points[i].x<minX) minX = points[i].x;
		if (points[i].y<minY) minY = points[i].y;
		if (points[i].z<minZ) minZ = points[i].z;
		if (points[i].x>maxX) maxX = points[i].x;
		if (points[i].y>maxY) maxY = points[i].y;
		if (points[i].z>maxZ) maxZ = points[i].z;
	}
	
	minBound.set(minX,minY,minZ);
	maxBound.set(maxX,maxY,maxZ);
	averagePosition.set((minX+maxX)/2, (minY+maxY)/2, (minZ+maxZ)/2);
  
  }