gl.Frustum(left, right, bottom, top, zNear, zFar)
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.
#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() .
#GL_MATRIX_MODE
gl.Get() with argument #GL_MODELVIEW_MATRIX
gl.Get() with argument #GL_PROJECTION_MATRIX
gl.Get() with argument #GL_TEXTURE_MATRIX