cf_perspective¶
Category: math
GitHub: cute_math3d.h
Builds a right-handed perspective projection matrix.
| Parameters | Description |
|---|---|
fov_radians |
The vertical field of view. |
aspect |
The viewport aspect ratio, width divided by height. |
znear |
Distance to the near clip plane. Must be greater than zero. |
zfar |
Distance to the far clip plane. |
Return Value¶
Returns a matrix mapping the view frustum to clip space.
Remarks¶
Right-handed, with clip-space z in [0, 1] -- znear maps to 0 and zfar to 1. See
cf_ortho for why that convention is not optional on SDL_GPU. Pairs with
CF_COMPARE_FUNCTION_LESS_THAN and a depth clear of 1.0.