1GLFRUSTUM(3G) GLFRUSTUM(3G)
2
3
4
6 glFrustum - multiply the current matrix by a perspective matrix
7
8
10 void glFrustum( GLdouble left,
11 GLdouble right,
12 GLdouble bottom,
13 GLdouble top,
14 GLdouble near_val,
15 GLdouble far_val )
16
17
19 left, right Specify the coordinates for the left and right vertical
20 clipping planes.
21
22 bottom, top Specify the coordinates for the bottom and top horizontal
23 clipping planes.
24
25 near_val, far_val
26 Specify the distances to the near and far depth clipping
27 planes. Both distances must be positive.
28
30 glFrustum describes a perspective matrix that produces a perspective
31 projection. The current matrix (see glMatrixMode) is multiplied by
32 this matrix and the result replaces the current matrix, as if
33 glMultMatrix were called with the following matrix as its argument:
34
35
36
37 ⎡⎣r_2i_ng_eh_at_r−__l_ve_af_lt_ 0 A 0⎤⎦
38 0 t_2o_np_e−_ab_ro__t_vt_ao_lm_ B 0
39 0 0 C D
40 0 0 −1 0
41
42 A=rr_ii_gg_hh_tt_+−_ll_ee_ff_tt_
43
44
45 B=tt_oo_pp_+−_bb_oo_tt_tt_oo_mm_
46
47
48 C=−ff_aa_rr____vv_aa_ll_+−_nn_ee_aa_rr____vv_aa_ll_
49
50
51 D=−2f_fa_ar_r___v_va_al_l−_nn_ee_aa_rr____vv_aa_ll_
52
53
54
55 Typically, the matrix mode is GL_PROJECTION, and (left, bottom,
56 -near_val) and (right, top, -near_val) specify the points on the near
57 clipping plane that are mapped to the lower left and upper right cor‐
58 ners of the window, assuming that the eye is located at (0, 0, 0).
59 -far_val specifies the location of the far clipping plane. Both
60 near_val and far_val must be positive.
61
62 Use glPushMatrix and glPopMatrix to save and restore the current matrix
63 stack.
64
66 Depth buffer precision is affected by the values specified for near_val
67 and far_val. The greater the ratio of far_val to near_val is, the less
68 effective the depth buffer will be at distinguishing between surfaces
69 that are near each other. If
70
71 r=n_fe_aa_rr____vv_aa_ll_
72
73 roughly log2(r) bits of depth buffer precision are lost. Because r
74 approaches infinity as near_val approaches 0, near_val must never be
75 set to 0.
76
78 GL_INVALID_VALUE is generated if near_val or far_val is not positive,
79 or if left = right, or bottom = top.
80
81 GL_INVALID_OPERATION is generated if glFrustum is executed between the
82 execution of glBegin and the corresponding execution of glEnd.
83
85 glGet with argument GL_MATRIX_MODE
86 glGet with argument GL_MODELVIEW_MATRIX
87 glGet with argument GL_PROJECTION_MATRIX
88 glGet with argument GL_TEXTURE_MATRIX
89 glGet with argument GL_COLOR_MATRIX
90
92 glOrtho(3G), glMatrixMode(3G), glMultMatrix(3G), glPushMatrix(3G),
93 glViewport(3G)
94
95
96
97 GLFRUSTUM(3G)