MatrixD.perspective constructor

MatrixD.perspective(
  1. double fovY,
  2. double aspect,
  3. double nearPlane,
  4. double farPlane,
)

Implementation

factory MatrixD.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);
}