MatrixD.perspective constructor
Returns a perspective projection matrix from a vertical FOV fovY (in radians), aspect ratio, and clip planes.
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);
}