Sign in to follow this  

Cube Front Corner Culled...Why?

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this