changing winding order for front facing triangles

Started by
3 comments, last by nitzan 19 years, 11 months ago
What is the Direct3D equivalent of the OpenGL call glFrontFace ? I am trying to change the winding order of front facing triangles. Thanks, Nitzan
Advertisement
Switch the culling mode.
I am not trying to cull away the front or back triangles. I am simply trying to change the front triangles to back and the back to front and I still want to draw them both.

D3DCULL is the equivalent of glCullFace, I am looking for the equivalent of glFrontFace (if such an equivalent exists, which I imagine it does).

Nitzan
There is no DirectX equivalent that I know of. But if you just want to change the winding order (aka flipping the normals) of all your faces.. 3 Vertices (a, b, c) make a triangle/face. To change the winding order of the triangle, just flip the a and c verticies. So instead of having triangle (a, b, c) you''d have triangle (c, b, a)

You could easily write a function that takes an array of triangles that computes this or simply do the swap when you''re filling up a vertex buffer. Whatever floats your boat.
I''m going to learn OpenGL.

--
You''re Welcome,
Rick Wong
- Google | Google for GameDev.net

This topic is closed to new replies.

Advertisement