Function perspective
Build a perspective projection matrix with NDC selected at run-time.
Parameters
Name | Description |
---|---|
ndc | the target NDC |
fovx | horizontal field of view in degrees |
aspect | aspect ratio (width / height) |
near | position of the near plane |
far | position of the far plane |
Returns
a matrix that maps from eye space to clip space. To obtain NDC, the vector must be divided by w.