25

We have two options in triangle winding direction,

  1. clock-wise
  2. counter-clockwise

Anyway converting between them could take some cost. I want to avoid conversion as much as possible, and to do that, I need to know de facto standard of winding direction. I think there's one because many big corporations are using OpenGL, and I think if there's one direction which is used by most of them, that's de facto standard.

If there's no such thing, please let me know.

JWWalker
  • 22,385
  • 6
  • 55
  • 76
eonil
  • 83,476
  • 81
  • 317
  • 516
  • I believe if the triangle is wound counter-clockwise that you are looking at the front. – Vaughn Cato Aug 18 '12 at 04:41
  • 1
    "Anyway converting between them could take some cost." Alternatively, it could cost *nothing*. Just change the winding order in OpenGL; it's not hard. – Nicol Bolas Aug 18 '12 at 05:01
  • 3
    @NicolBolas Well... in theory, it's just only changing a state, but in practice, I have many problems when using dual facing. For example, when merging meshes, when mixing vertex attributes. And it needs all meshes to be tagged with facing. Processing logic also should be branched. Also, it makes me to make more mistakes for increased possibilities. – eonil Aug 18 '12 at 05:08

2 Answers2

29

The OpenGL Programming guide says "By convention, polygons whose vertices appear in counterclockwise order on the screen are called front-facing."

Vaughn Cato
  • 63,448
  • 5
  • 82
  • 132
17

The documentation on glFrontFace says that the default is GL_CCW.

JWWalker
  • 22,385
  • 6
  • 55
  • 76