matrix_set

This function takes an array of 16 values, corresponding to a given 4x4 matrix type, where elements [0 - 3] would be row 1, elements [4 -7] would be row 2, etc... (see the image on the main page). You can create such a matrix using the matrix_build() or matrix_get() functions or simply building the array yourself and passing that into the function. The available matrix types are view, projection and world, for which you would use one of the following constants:

ConstantDescription
matrix_viewThe current view matrix
matrix_projectionThe current projection matrix
matrix_worldThe current world matrix

 

Syntax:

matrix_set(type, matrix);

ArgumentTypeDescription
typeMatrix Type ConstantThe type of matrix to get the values of (see the constants listed above)
matrixMatrix ArrayThe matrix data as an array

 

Returns:

N/A

 

Example:

matrix_set(matrix_world, m_array);

The above code will set the values of the current world matrix to those stored in the array matrix "m_array".