use of com.nilunder.bdx.gl.Viewport in project bdx by GoranM.
the class Camera method rayData.
public Vector3f[] rayData(Vector2f p) {
Viewport vp = scene.viewport;
Ray pr = data.getPickRay(p.x, Bdx.display.height() - p.y, vp.x, vp.y, vp.w, vp.h);
return new Vector3f[] { new Vector3f(pr.origin.x, pr.origin.y, pr.origin.z), new Vector3f(pr.direction.x, pr.direction.y, pr.direction.z) };
}
use of com.nilunder.bdx.gl.Viewport in project bdx by GoranM.
the class Camera method screenPosition.
public Vector2f screenPosition(Vector3f p) {
Viewport vp = scene.viewport;
Vector3 out = data.project(new Vector3(p.x, p.y, p.z), vp.x, vp.y, vp.w, vp.h);
return new Vector2f(Math.round(out.x), Math.round(out.y));
}