/** * Create a viewFrustum from the given parameters. * * @param eye * @param lookingAt * @param up * @param fovy * the field-of-view in y direction * @param aspect * @param zNear * @param zFar */ public ViewFrustum( Point3d eye, Point3d lookingAt, Vector3d up, double fovy, double aspect, double zNear, double zFar ) { setPerspectiveParams( fovy, aspect, zNear, zFar ); setCameraParams( eye, lookingAt, up ); }
/** * Create a view Frustum by using the given roll, pitch, yaw and distance to the point of interest (looking at), to * calculate the eye and the up vector. * * @param pitch * @param yaw * @param roll * @param distance * @param lookingAt * @param fovy * the field-of-view in y direction * @param aspect * @param zNear * @param zFar */ public ViewFrustum( double pitch, double yaw, double roll, double distance, Point3d lookingAt, double fovy, double aspect, double zNear, double zFar ) { Point3d calculatedEye = calcObserPosition( lookingAt, pitch, yaw, distance ); Vector3d calculatedUp = calcUp( roll, calculatedEye, lookingAt ); setPerspectiveParams( fovy, aspect, zNear, zFar ); setCameraParams( calculatedEye, lookingAt, calculatedUp ); }
/** * Set the new projection plane dimensions * * @param width * @param height */ public void setProjectionPlaneDimensions( int width, int height ) { projectionWidth = width; projectionHeight = height; double aspect = (double) width / height; vf.setPerspectiveParams( vf.getFOVY(), aspect, vf.getZNear(), vf.getZFar() ); vf.setCameraParams( vf.getEyePos(), vf.getLookingAt(), vf.getUp() ); }