matrix_build_projection_perspective_fov


Description

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);


Arguments:

Argument Description
fov The angle of the field of view.
aspect The aspect ratio of the field of view.
znear The near clipping plane.
zfar The far clipping plane.


Returns:

Matrix index


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].


Back: Matrix Functions
Next: matrix_transform_vertex
© Copyright YoYo Games Ltd. 2018 All Rights Reserved