# FreeBSD Manual Pages

GLFRUSTUM() GLFRUSTUM()NAMEglFrustum- multiply the current matrix by a perspective matrixC SPECIFICATIONvoidglFrustum( GLdoubleleft, GLdoubleright, GLdoublebottom, GLdoubletop, GLdoublezNear, GLdoublezFar) delim $$PARAMETERSleft,rightSpecify the coordinates for the left and right vertical clipping planes.bottom,topSpecify the coordinates for the bottom and top horizontal clipping planes.zNear,zFarSpecify the distances to the near and far depth clipping planes. Both distances must be positive.DESCRIPTIONglFrustumdescribes a perspective matrix that produces a perspective projection. The current matrix (seeglMatrixMode) is multiplied by this matrix and the result replaces the current matrix, as ifglMultMa-trixwere called with the following matrix as its argument: down 130 {left ( ~~ matrix { ccol { {{2 ~ "zNear"} over {"right" - "left"}} above 0 above 0 above 0 } ccol { 0 above {{2 ~ "zNear"} over {"top" - "bottom"}} ~ above 0 above 0 } ccol { A ~~~~ above B ~~~~ above C ~~~~ above -1 ~~~~} ccol { 0 above 0 above D above 0} } ~~~ right )} down 130 {A ~=~ {"right" + "left"} over {"right" - "left"}} down 130 {B ~=~ {"top" + "bottom"} over {"top" - "bottom"}} down 130 {C ~=~ -{{"zFar" + "zNear"} over {"zFar" - "zNear"}}} down 130 {D ~=~ -{{2 ~ "zFar" ~ "zNear"} over {"zFar" - "zNear"}}} Typically, the matrix mode isGL_PROJECTION, and (left,bottom, -zNear) and (right,top, -zNear) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the win- dow, assuming that the eye is located at (0, 0, 0). -zFarspecifies the location of the far clipping plane. BothzNearandzFarmust be positive. UseglPushMatrixandglPopMatrixto save and restore the current matrix stack.NOTESDepth buffer precision is affected by the values specified forzNearandzFar. The greater the ratio ofzFartozNearis, the less effec- tive the depth buffer will be at distinguishing between surfaces that are near each other. If $r ~=~ "zFar" over "zNear"$ roughly $log sub 2 (r)$ bits of depth buffer precision are lost. Be- cause $r$ approaches infinity aszNearapproaches 0,zNearmust never be set to 0.ERRORSGL_INVALID_VALUEis generated ifzNearorzFaris not positive.GL_INVALID_OPERATIONis generated ifglFrustumis executed between the execution ofglBeginand the corresponding execution ofglEnd.ASSOCIATED GETSglGetwith argumentGL_MATRIX_MODEglGetwith argumentGL_MODELVIEW_MATRIXglGetwith argumentGL_PROJECTION_MATRIXglGetwith argumentGL_TEXTURE_MATRIXSEE ALSOglOrtho,glMatrixMode,glMultMatrix,glPushMatrix,glViewportGLFRUSTUM()

NAME | C SPECIFICATION | PARAMETERS | DESCRIPTION | NOTES | ERRORS | ASSOCIATED GETS | SEE ALSO

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=glFrustum&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>