Advertisement

Can't Get CCW Winding Order to Work

Started by June 01, 2017 11:32 PM
1 comment, last by dmatter 7 years, 8 months ago

Hi guys,

The only way I can get a CCW winding order to work is to use D3D11_CULL_NONE. Take a look:


// ccw triangle on x-z plane
a = (-8.0f, 0.0f, -8.0f);
b = ( 8.0f, 0.0f, -8.0f);
c = ( 8.0f, 0.0f,  8.0f);
rasterDesc.CullMode = D3D11_CULL_BACK;
rasterDesc.FrontCounterClockwise = TRUE;
// that doesn't work
// if I swap b with c,  and set FrontCounterClockwise = FALSE it works

I am really confused.

Thanks.

How do those vertices can transformed to NDC coordinates? i.e. where is the camera and what is the vertex shader.
If you look at those verts from one side they're CW and the other side they're CCW. From your code there's no way for us to know which it is.

Advertisement
So I think you would have to be using a left-handed coordinate system (typical for D3D) with the camera looking down on the triangle to see it.
Does that match with what you have going on?

This topic is closed to new replies.

Advertisement