This function builds a perspective projection matrix matrix based on the dimensions of the near plane, using the specified parameters listed below.
matrix_build_projection_perspective(width, height, znear, zfar);
| Argument | Description |
|---|---|
| w | The width of the projection. |
| h | The height of the projection. |
| znear | The near clipping plane. |
| zfar | The far clipping plane. |
Matrix index
var projmat =
matrix_build_projection_perspective(640, 480, 1.0, 32000.0);
camera_set_proj_mat(view_camera[0], projmat);
The above code creates a perspective projection and then uses the matrix returned to set the camera assigned to view port[0].