A transformation is expressed as a 4x4 floating-point matrix. You can build complex transformations by linking a series of primitive transformation subroutines, such as rotate , rot , translate , or scale . The graphics pipeline maintains a stack that holds up to 32 transformation matrices. The graphics pipeline forms a complex transformation matrix by premultiplying the current matrix by each primitive transformation. The projection, viewing, and modeling subroutines provide a high-level interface that manages the transformation matrix stack.
Additional subroutines allow direct control over the stack.
These subroutines load or multiply user-defined transformation matrices, push and pop the transformation stack, and retrieve the matrix on the top of the stack. The loadmatrix subroutine loads a 4x4 floating-point matrix onto the stack, replacing the current top of the stack. The multmatrix subroutine premultiplies the current top of the transformation stack by the given matrix. The getmatrix subroutine copies the transformation matrix from the top of the transformation stack to an array provided by the user. The stack does not change.