perspective

Build a perspective projection matrix with NDC selected at run-time.

pure @safe @nogc nothrow
perspective
(
T
)
(,
in T fovx
,
in T aspect
,
in T near
,
in T far
)

Parameters

ndc NDC

the target NDC

fovx T

horizontal field of view in degrees

aspect T

aspect ratio (width / height)

near T

position of the near plane

far T

position of the far plane

Return Value

Type: Mat4!T

a matrix that maps from eye space to clip space. To obtain NDC, the vector must be divided by w.

Meta