1GLFRUSTUM(3G)                    OpenGL Manual                   GLFRUSTUM(3G)
2
3
4

NAME

6       glFrustum - multiply the current matrix by a perspective matrix
7

C SPECIFICATION

9       void glFrustum(GLdouble left, GLdouble right, GLdouble bottom,
10                      GLdouble top, GLdouble nearVal, GLdouble farVal);
11

PARAMETERS

13       left, right
14           Specify the coordinates for the left and right vertical clipping
15           planes.
16
17       bottom, top
18           Specify the coordinates for the bottom and top horizontal clipping
19           planes.
20
21       nearVal, farVal
22           Specify the distances to the near and far depth clipping planes.
23           Both distances must be positive.
24

DESCRIPTION

26       glFrustum describes a perspective matrix that produces a perspective
27       projection. The current matrix (see glMatrixMode()) is multiplied by
28       this matrix and the result replaces the current matrix, as if
29       glMultMatrix() were called with the following matrix as its argument:
30
31       2 ⁢ nearVal right - left 0 A 0 0 2 ⁢ nearVal top - bottom B 0 0 0 C D 0
32       0 -1 0
33
34       A = right + left right - left
35
36       B = top + bottom top - bottom
37
38       C = - farVal + nearVal farVal - nearVal
39
40       D = - 2 ⁢ farVal ⁢ nearVal farVal - nearVal
41
42       Typically, the matrix mode is GL_PROJECTION, and left bottom - nearVal
43       and right top - nearVal specify the points on the near clipping plane
44       that are mapped to the lower left and upper right corners of the
45       window, assuming that the eye is located at (0, 0, 0).  - farVal
46       specifies the location of the far clipping plane. Both nearVal and
47       farVal must be positive.
48
49       Use glPushMatrix() and glPopMatrix() to save and restore the current
50       matrix stack.
51

NOTES

53       Depth buffer precision is affected by the values specified for nearVal
54       and farVal. The greater the ratio of farVal to nearVal is, the less
55       effective the depth buffer will be at distinguishing between surfaces
56       that are near each other. If
57
58       r = farVal nearVal
59
60       roughly log 2 ⁡ r bits of depth buffer precision are lost. Because r
61       approaches infinity as nearVal approaches 0, nearVal must never be set
62       to 0.
63

ERRORS

65       GL_INVALID_VALUE is generated if nearVal or farVal is not positive, or
66       if left = right, or bottom = top, or near = far.
67
68       GL_INVALID_OPERATION is generated if glFrustum is executed between the
69       execution of glBegin() and the corresponding execution of glEnd().
70

ASSOCIATED GETS

72       glGet() with argument GL_MATRIX_MODE
73
74       glGet() with argument GL_MODELVIEW_MATRIX
75
76       glGet() with argument GL_PROJECTION_MATRIX
77
78       glGet() with argument GL_TEXTURE_MATRIX
79
80       glGet() with argument GL_COLOR_MATRIX
81

SEE ALSO

83       glOrtho(), glMatrixMode(), glMultMatrix(), glPushMatrix(), glViewport()
84
86       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
87       under the SGI Free Software B License. For details, see
88       http://oss.sgi.com/projects/FreeB/.
89

AUTHORS

91       opengl.org
92
93
94
95opengl.org                        06/10/2014                     GLFRUSTUM(3G)
Impressum