Page 348 OpenGL Super Bible! glCullFace Purpose Specifies whether the front or back of polygons should be eliminated from drawing. Include File Syntax void glCullFace(GLenum mode); Description This function disables lighting, shading, and color calculations and operations on either the front or back of a polygon. If, for instance, an object is closed in so that the back side of the polygons will never be visible regardless of rotation or translation, this will eliminate unnecessary computations in the display of the scene. Culling is enabled or disabled by calling glEnable and glDisable with the GL_CULL_FACE parameter. The front and back of the polygon are defined by use of the glFrontFace function and the order in which the vertices are specified (clockwise or counterclockwise winding). Parameters mode GLenum: Specifies which face of polygons should be culled. May be either GL_FRONT, or GL_BACK. Returns None. Example The following code from the AMBIENT example from this chapter shows how the color and drawing operations are disabled for the inside of the jet. It is also necessary to indicate which side of the polygon is the outside by specifying clockwise or counterclockwise winding. glEnable(GL_CULL_FACE); // Do not calculate inside of jet glFrontFace(GL_CCW); // Counterclockwise polygons face out See Also glFrontFace, glLightModel
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.
This entry was posted
on Wednesday, September 12th, 2007 at 9:02 pm and is filed under Coldfusion.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.