GLFRUSTUM(3G)
π¦ glFrustum(3G) β 3G manual, bestie π¦
okay so welcome to the glFrustum(3G) page from the 3G manual π this is the one that does perspective matrix magic, no cap. let's get into it β¨
π NAME π
glFrustum β multiply the current matrix by a perspective matrix. that's the whole vibe, periodt.
π C SPECIFICATION π
void glFrustum( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble near_val,
GLdouble far_val )
π PARAMETERS π
left,rightβ these specify the coordinates for the left and right vertical clipping planes. π¦bottom,topβ these specify the coordinates for the bottom and top horizontal clipping planes. πΈnear_val,far_valβ these specify the distances to the near and far depth clipping planes. both distances must be positive (no cap, fr).
β¨ DESCRIPTION β¨
glFrustum describes a perspective matrix that produces a perspective projection. the current matrix (see glMatrixMode) is multiplied by this matrix and the result replaces the current matrix, as if glMultMatrix were called with the following matrix as its argument:
β£__________ 0 A 0β¦
0 __________ B 0
0 0 C D
0 0 β1 0
A=__________
B=__________
C=β________________
D=β________________
typically, the matrix mode is GL_PROJECTION, and (left, bottom, -near_val) and (right, top, -near_val) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, assuming that the eye is located at (0, 0, 0). -far_val specifies the location of the far clipping plane. both near_val and far_val must be positive. π―
use glPushMatrix and glPopMatrix to save and restore the current matrix stack. iconic behavior.
π NOTES π
depth buffer precision is affected by the values specified for near_val and far_val. the greater the ratio of far_val to near_val is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. if
r=________
roughly log2(r) bits of depth buffer precision are lost. because r approaches infinity as near_val approaches 0, near_val must never be set to 0. like, ever. not even once. π«
π¨ ERRORS π¨
GL_INVALID_VALUEis generated ifnear_valorfar_valis not positive, or ifleft = right, orbottom = top.GL_INVALID_OPERATIONis generated ifglFrustumis executed between the execution ofglBeginand the corresponding execution ofglEnd.
π ASSOCIATED GETS π
glGetwith argumentGL_MATRIX_MODEglGetwith argumentGL_MODELVIEW_MATRIXglGetwith argumentGL_PROJECTION_MATRIXglGetwith argumentGL_TEXTURE_MATRIXglGetwith argumentGL_COLOR_MATRIX
π SEE ALSO π
glOrtho(3G), glMatrixMode(3G), glMultMatrix(3G), glPushMatrix(3G), glViewport(3G)
that's the tea bestie! this page is from the 3G manual, source is GLFRUSTUM(3G), and the footer just says GLFRUSTUM(3G) with no date β iconic. stay perspective-projected, mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms