public Point projectScreen(Vector23f p) { Ray3f eye2P = new Ray3f(eye, p); Vector23f proj = eye2P.intersect(viewPlane); proj.x -= (eye.x - width / 2); proj.y -= (eye.y - height / 2); return new Point((int) proj.x, (int) proj.y); }
public void moveEye(float deltaX, float deltaY, float deltaZ) { eye.x -= deltaX; eye.y -= deltaY; if (eye.z - deltaZ > 0) { eye.z -= deltaZ; } findViewPlane(); }
public void fitRange(float width, float height) { float z1 = this.viewPlaneFromEye * (width / this.width); float z2 = this.viewPlaneFromEye * (height / this.height); eye.z = (z1 > z2) ? z1 : z2; }
public void moveEyeTo(float x, float y) { eye.x = x; eye.y = y; }