Function ortho

Build an orthographic projection matrix with NDC determined at runtime

Mat4!T ortho(T) (
  NDC ndc,
  in T l,
  in T r,
  in T b,
  in T t,
  in T n,
  in T f
);

Parameters

NameDescription
ndc the target NDC
l X position of the left plane
r X position of the right plane
b Y position of the bottom plane
t Y position of the top plane
n distance from origin to near plane (in Z-)
f distance from origin to far plane (in Z-)

Returns

an affine matrix that maps from eye coordinates to NDC.