matrix_build_projection_perspective_fov

This function builds a perspective projection matrix matrix based on field of view, using the specified parameters listed below.

 

Syntax:

matrix_build_projection_perspective_fov(fov_y, aspect, znear, zfar);

ArgumentTypeDescription
fovRealThe angle of the field of view.
aspectRealThe aspect ratio of the field of view.
znearRealThe near clipping plane.
zfarRealThe far clipping plane.

 

Returns:

Matrix Array

 

Example:

projmat = matrix_build_projection_perspective_fov(60, 320/240, 1.0, 32000.0);
camera_set_proj_mat(view_camera[0], projmat);

The above code creates a field of view projection matrix which is then stored in a variable. This matrix is then used to set up the camera assigned to view port[0].