class MyPoint { float x, y, z; MyPoint(float xinput, float yinput, float zinput){ x = xinput; y = yinput; z = zinput; } void move(float xoff, float yoff, float zoff){ x = x + xoff; y = y + yoff; z = z + zoff; } void scale(float xs, float ys, float zs){ x = x * xs; y = y * ys; z = z * zs; } // Rotation around the z-axis void rotatez(float angle ){ float tempx = x * cos(angle) - y * sin(angle); float tempy = y * cos(angle) + x * sin(angle); x = tempx; y = tempy; } //Rotation around the x-axis void rotatex(float angle ){ float tempy = y * cos(angle) - z * sin(angle); float tempz = z * cos(angle) + y * sin(angle); y = tempy; z = tempz; } //Rotation around the y-axis void rotatey(float angle ){ float tempx = x * cos(angle) - z * sin(angle); float tempz = z * cos(angle) + x * sin(angle); x = tempx; z = tempz; } int xP(float eye){ float t = 1.0/(1.0+((float) z / eye )); int px = int( x * t); return(px); } int yP(float eye){ float t = 1.0/(1.0+((float) z / eye )); int py = int( y * t); return(py); } }