public Vector23f projectGroud(Point2D.Float _p) { Vector23f p = new Vector23f(_p.x + (eye.x - width / 2), _p.y + (eye.y - height / 2), viewPlane.d); Ray3f eye2P = new Ray3f(eye, p); Vector23f proj = eye2P.intersect(ground); return proj; }
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); }