perspective static method

MatrixBase<MatrixBase, Vector3Base, QuaternionBase, Vector4Base> perspective(
  1. double fovY,
  2. double aspect,
  3. double nearPlane,
  4. double farPlane,
)

Returns a perspective projection matrix from a vertical FOV fovY (in radians), aspect ratio, and clip planes.

Implementation

static MatrixBase perspective(
  double fovY,
  double aspect,
  double nearPlane,
  double farPlane,
) {
  final top = nearPlane*math.tan(fovY*0.5);
  final right = top*aspect;

  return frustum(-right, right, -top, top, nearPlane, farPlane);
}