1GLPUSHMATRIX(3G) OpenGL Manual GLPUSHMATRIX(3G)
2
3
4
6 glPushMatrix - push and pop the current matrix stack
7
9 void glPushMatrix(void);
10
12 void glPopMatrix(void);
13
15 There is a stack of matrices for each of the matrix modes. In
16 GL_MODELVIEW mode, the stack depth is at least 32. In the other modes,
17 GL_COLOR, GL_PROJECTION, and GL_TEXTURE, the depth is at least 2. The
18 current matrix in any mode is the matrix on the top of the stack for
19 that mode.
20
21 glPushMatrix pushes the current matrix stack down by one, duplicating
22 the current matrix. That is, after a glPushMatrix call, the matrix on
23 top of the stack is identical to the one below it.
24
25 glPopMatrix() pops the current matrix stack, replacing the current
26 matrix with the one below it on the stack.
27
28 Initially, each of the stacks contains one matrix, an identity matrix.
29
30 It is an error to push a full matrix stack or to pop a matrix stack
31 that contains only a single matrix. In either case, the error flag is
32 set and no other change is made to GL state.
33
35 GL_STACK_OVERFLOW is generated if glPushMatrix is called while the
36 current matrix stack is full.
37
38 GL_STACK_UNDERFLOW is generated if glPopMatrix() is called while the
39 current matrix stack contains only a single matrix.
40
41 GL_INVALID_OPERATION is generated if glPushMatrix or glPopMatrix() is
42 executed between the execution of glBegin() and the corresponding
43 execution of glEnd().
44
46 glGet() with argument GL_MATRIX_MODE
47
48 glGet() with argument GL_COLOR_MATRIX
49
50 glGet() with argument GL_MODELVIEW_MATRIX
51
52 glGet() with argument GL_PROJECTION_MATRIX
53
54 glGet() with argument GL_TEXTURE_MATRIX
55
56 glGet() with argument GL_COLOR_MATRIX_STACK_DEPTH
57
58 glGet() with argument GL_MODELVIEW_STACK_DEPTH
59
60 glGet() with argument GL_PROJECTION_STACK_DEPTH
61
62 glGet() with argument GL_TEXTURE_STACK_DEPTH
63
64 glGet() with argument GL_MAX_MODELVIEW_STACK_DEPTH
65
66 glGet() with argument GL_MAX_PROJECTION_STACK_DEPTH
67
68 glGet() with argument GL_MAX_TEXTURE_STACK_DEPTH
69
71 glFrustum(), glLoadIdentity(), glLoadMatrix(), glLoadTransposeMatrix(),
72 glMatrixMode(), glMultMatrix(), glMultTransposeMatrix(), glOrtho(),
73 glRotate(), glScale(), glTranslate(), glViewport()
74
76 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
77 under the SGI Free Software B License. For details, see
78 http://oss.sgi.com/projects/FreeB/.
79
81 opengl.org
82
83
84
85opengl.org 07/13/2018 GLPUSHMATRIX(3G)