[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glFrontFace Subroutine

Purpose

Defines frontfacing and backfacing polygons.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glFrontFace(GLenum Mode)

Parameters

Mode Specifies the orientation of frontfacing polygons. GL_CW and GL_CCW are accepted. The default value is GL_CCW.

Description

In a scene composed entirely of opaque closed surfaces, backfacing polygons are never visible. Eliminating these invisible polygons speeds up the rendering of the image. Backface elimination is enabled and disabled with glEnable and glDisable using argument GL_CULL_FACE.

The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. The glFrontFace subroutine specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be frontfacing. Passing GL_CCW to the Mode parameter selects counterclockwise polygons as frontfacing; GL_CW selects clockwise polygons as frontfacing. By default, counterclockwise polygons are taken to be frontfacing.

Errors

GL_INVALID_ENUM Mode is not an accepted value.
GL_INVALID_OPERATION The glFrontFace subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glFrontFace subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_FRONT_FACE.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glCullFace subroutine, glLightModel subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]