예제 #1
0
  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);
  }
예제 #2
0
  public void moveEye(float deltaX, float deltaY, float deltaZ) {
    eye.x -= deltaX;
    eye.y -= deltaY;

    if (eye.z - deltaZ > 0) {
      eye.z -= deltaZ;
    }

    findViewPlane();
  }
예제 #3
0
 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;
 }
예제 #4
0
 public void moveEyeTo(float x, float y) {
   eye.x = x;
   eye.y = y;
 }