matrix_build_projection_perspective


Description

This function builds a perspective projection matrix matrix based on the dimensions of the near plane, using the specified parameters listed below.


Syntax:

matrix_build_projection_perspective(width, height, znear, zfar);


Arguments:

Argument Description
w The width of the projection.
h The height of the projection.
znear The near clipping plane.
zfar The far clipping plane.


Returns:

Matrix index


Example:

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


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