Name
gl.Frustum -- multiply the current matrix by a perspective matrix
Synopsis
gl.Frustum(left, right, bottom, top, zNear, zFar)
Function
gl.Frustum() describes a perspective matrix that produces a perspective projection. (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 window, respectively, assuming that the eye is located at (0, 0, 0). -zFar specifies the location of the far clipping plane. Both zNear and zFar must be positive. Consult an OpenGL reference for the corresponding matrix.

The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and F is the frustum perspective matrix, then M is replaced with M*F.

Use gl.PushMatrix() and gl.PopMatrix() to save and restore the current matrix stack.

Depth buffer precision is affected by the values specified for zNear and zFar. The greater the ratio of far to near is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If

 
r = zFar / zNear

roughly ld(r) bits of depth buffer precision are lost. Because r approaches infinity as zNear approaches zero, zNear must never be set to zero.

Please consult an OpenGL reference manual for more information.

Inputs
left
specify the coordinate for the left vertical clipping plane
right
specify the coordinate for the right vertical clipping plane
bottom
specify the coordinate for the bottom horizontal clipping plane
top
specify the coordinate for the top horizontal clipping plane
zNear
specify the distance to the near depth clipping plane; must be positive
zFar
specify the distance to the far depth clipping plane; must be positive
Errors
#GL_INVALID_VALUE is generated if zNear or zFar is not positive, or if left = right, or bottom = top, or zNear = zFar.

#GL_INVALID_OPERATION is generated if gl.Frustum() is executed between the execution of gl.Begin() and the corresponding execution of gl.End() .

Associated gets
gl.Get() with argument #GL_MATRIX_MODE

gl.Get() with argument #GL_MODELVIEW_MATRIX

gl.Get() with argument #GL_PROJECTION_MATRIX

gl.Get() with argument #GL_TEXTURE_MATRIX


Show TOC