#### Archived

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

# How does back face culling work?

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

## Recommended Posts

When I turn culling on in my D3D8 app, instead of back faces, I get my front faces culled. I am totally sure that my normals are set correctly. I even flipped them to see if that was the problem. I assume culling determines the faces that will not be rendered by checking the normal vectors, is this a correct assumption? If not, then how does culling work? rk

##### Share on other sites

->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
or
->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW );

##### Share on other sites
Culling has nothing to do with normals.

Culling is dependant on which way the triangles are drawn. Triangles consist of 3 points and a "list of which dots to connect."

1---2     2---1|  /       \  || /         \ ||/           \|3             3

Let''s say you have these 2 triangles on the screen. The one on the left you want facing the camera, the one on the right facing the other way.

If you draw the left triangle connecting the dots like 1-2-3, that is going clockwise... It will be drawn... If the cullmode is CCW that means if you connect the dots counter-lockwise like 3-2-1 will be discarded.

So, to make the one on the right display backwards, what do you do? =) Draw it 1-2-3... =) Thats going counterclockwise and will be drawn in reverse facing the other way. To change the one on the right to face the camera. Change the way its drawn to 2-1-3, or 1-3-2 so the "connect the dots" are going clockwise...

1. 1
2. 2
3. 3
4. 4
Rutin
18
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631423
• Total Posts
3000005
×