4x4 Matrices More...
Functions | |
| void | matrix4_perspective (matrix4 mtx, float fov, float aspect, float near, float far) |
| Generate a perspective projection matrix. | |
| void | matrix4_orthographic (matrix4 mtx, float left, float right, float bottom, float top, float near, float far) |
| Generate a orthographic projection matrix. | |
4x4 Matrices
Your standard column major 4x4 matrix you all know and love.
| void matrix4_orthographic | ( | matrix4 | mtx, |
| float | left, | ||
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | near, | ||
| float | far ) |
Generate a orthographic projection matrix.
Transforms points to screen space with no perspective adjustment. So objects remain the same size no matter the Z. Z is treated like 2D layers.
Each feild shows the corners of the 2D space that the points take place in, and will then be projected to the screen.
Points outside are clipped.
| mtx | Matrix to save output into |
| left | Left most boundary. |
| right | Right most boundary. |
| bottom | Bottom most boundary. |
| top | top most boundary. |
| near | Near Z of the view area. Things outside of it will be clipped. |
| far | Far Z of the view area. Things outside of it will be clipped. |
| void matrix4_perspective | ( | matrix4 | mtx, |
| float | fov, | ||
| float | aspect, | ||
| float | near, | ||
| float | far ) |
Generate a perspective projection matrix.
Used to setup a perspective projection matrix to transform points into screen space such that they appear farther as they go into (-Z) of the screen.
| mtx | Matrix to save output into |
| fov | Feild of view in radians. |
| aspect | Aspect ration of the screen. Width / Height |
| near | Near Z of the view area. Things outside of it will be clipped. |
| far | Far Z of the view area. Things outside of it will be clipped. |