OrthographicProjection.matchingPerspective constructor

OrthographicProjection.matchingPerspective({
  1. required double fovRadiansY,
  2. required double distance,
  3. double near = 0.0,
  4. double far = 1000.0,
})

The orthographic projection that frames the plane distance in front of the camera the same way a perspective projection with fovRadiansY does, for switching projections without the view jumping.

Implementation

factory OrthographicProjection.matchingPerspective({
  required double fovRadiansY,
  required double distance,
  double near = 0.0,
  double far = 1000.0,
}) => OrthographicProjection(
  size: OrthographicSize.height(2.0 * distance * tan(fovRadiansY * 0.5)),
  near: near,
  far: far,
);