WebGLRenderingContext.frontFace()

The WebGLRenderingContext.frontFace() method of the WebGL API specifies whether polygons are front- or back-facing by setting a winding orientation.

SyntaxEdit

void gl.frontFace(mode);

Parameters

mode
Sets the winding orientation. The default value is gl.CCW. Possible values:
  • gl.CW: Clock-wise winding.
  • gl.CCW: Counter-clock-wise winding.

Return value

None.

ExamplesEdit

gl.frontFace(gl.CW);

SpecificationsEdit

Specification Status Comment
WebGL 1.0
The definition of 'frontFace' in that specification.
Recommendation Initial definition.
OpenGL ES 2.0
The definition of 'glFrontFace' in that specification.
Standard Man page of the OpenGL API.

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 9 4.0 (2.0) 11 12 5.1

See alsoEdit

Document Tags and Contributors

 Contributors to this page: fscholz
 Last updated by: fscholz,