Cube Front Corner Culled...Why?

Started by
1 comment, last by __Daedalus__ 19 years, 8 months ago
I've got a couple of simple cubes drawn and rotating. It seems that all of the triangles with their right angle corners at the frontmost corner of my cube are getting culled as if they were back facing. I know this because I set the cull mode to none and the problem goes away. I checked that I've defined my indexes in clockwise order. I'm not sure what else it could be. I'm rendering in wire frame mode. I certainly don't expect anybody to debug my code, but if somebody has run into this, or if this smells like a common mistake I would appreciate your advice.
Advertisement
try putting your indices in counter-clockwise order and see if things go right. or change the winding order that DirectX considers "front-facing" to be the opposite of what it's set to now. either you're expecting DirectX to think clockwise is front-facing and it doesn't, or you've actually got your indices in the wrong winding order.

-me
You can manipulate the cullmode of DirectX using one of these commands:

// pD3DDevice = Your D3D device.
pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW );
pD3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );

CW culls backfaces with clockwise vertices and CCW culls backfaces with counterclockwise vertices.

This topic is closed to new replies.

Advertisement