Archived

This topic is now archived and is closed to further replies.

nitzan

changing winding order for front facing triangles

Recommended Posts

What is the Direct3D equivalent of the OpenGL call glFrontFace ? I am trying to change the winding order of front facing triangles. Thanks, Nitzan

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites