replace the current matrix with the specified matrix

## C Specification

void glLoadMatrixd( const GLdouble *m )

void glLoadMatrixf( const GLfloat *m )

## Parameters

m

Specifies a pointer to 16 consecutive values, which are used as the elements of a $4\text{ }×\text{ }4$ column-major matrix.

## Description

glLoadMatrix replaces the current matrix with the one whose elements are specified by m. The current matrix is the projection matrix, modelview matrix, or texture matrix, depending on the current matrix mode (see glMatrixMode).

The current matrix, M, defines a transformation of coordinates. For instance, assume M refers to the modelview matrix. If  $v\text{ }=\text{ }\left(v\left[0\right],v\left[1\right],v\left[2\right],v\left[3\right]\right)$ is the set of object coordinates of a vertex, and m points to an array of $16$  single- or double-precision floating-point values $m\left[0\right],m\left[1\right],...,m\left[15\right]$, then the modelview transformation $M\left(v\right)$ does the following:

$M\left(v\right)\text{ }=\text{ }\left(\begin{array}{cccc}\hfill \text{ }m\left[0\right]\hfill & \hfill \text{ }m\left[4\right]\hfill & \hfill \text{ }m\left[8\right]\hfill & \hfill \text{ }m\left[12\right]\text{ }\hfill \\ \hfill m\left[1\right]\hfill & \hfill m\left[5\right]\hfill & \hfill m\left[9\right]\hfill & \hfill m\left[13\right]\text{ }\hfill \\ \hfill m\left[2\right]\hfill & \hfill m\left[6\right]\hfill & \hfill m\left[10\right]\hfill & \hfill m\left[14\right]\text{ }\hfill \\ \hfill m\left[3\right]\text{ }\hfill & \hfill m\left[7\right]\text{ }\hfill & \hfill m\left[11\right]\text{ }\hfill & \hfill m\left[15\right]\text{ }\hfill \end{array}\right)\text{ }\text{ }×\text{ }\text{ }\left(\begin{array}{c}\hfill \text{ }v\left[0\right]\text{ }\hfill \\ \hfill \text{ }v\left[1\right]\text{ }\hfill \\ \hfill \text{ }v\left[2\right]\text{ }\hfill \\ \hfill \text{ }v\left[3\right]\text{ }\hfill \end{array}\right)$

Where “$×$” denotes matrix multiplication.

Projection and texture transformations are similarly defined.

## Notes

While the elements of the matrix may be specified with single or double precision, the GL implementation may store or operate on these values in less than single precision.

## Errors

GL_INVALID_OPERATION is generated if glLoadMatrix is executed between the execution of glBegin and the corresponding execution of glEnd.

## Associated Gets

glGet with argument GL_MATRIX_MODE
glGet with argument GL_COLOR_MATRIX
glGet with argument GL_MODELVIEW_MATRIX
glGet with argument GL_PROJECTION_MATRIX
glGet with argument GL_TEXTURE_MATRIX