Meshes and Backface culling

Started by
4 comments, last by JasonBlochowiak 17 years, 9 months ago
The other day I was trying to get "bigship1.x" displayed on my screen using a right handed system. At first I didn't get any triangles at all, blank screen. I started tweaking out the program until I set the D3DRS_CULL to D3DCULLMODE_CW, or something like that. Although am happy that it got displayed after that, however I expected it to atleast show the inner faces of the mesh. Something over here is weird, or atleast I am missing out on something.. Please help.. Am in a paranoial phase right now
[ my blog ]
Advertisement
Well, changing handedness can change the apparent winding order of triangles, which can cause back/front-face flipping.

I would recommend adding a debug key to your program to let you switch between culling modes NONE, CW (clockwise), and CCW (counter-clockwise) to see what the effects are on the mesh you're trying to draw. Also, sometimes switching to wireframe rendering can help with debugging visualization.

Btw, if you want the front & backs of your triangles to render (so you would see the "inside" of the mesh), you would set the cull mode to NONE.
I was peculiarly addressing the fact that when I switched into CW, the mesh was rendered.. So that would mean that it should have rendered something when it was in CCW (the other side of the ship) but it didn't... If I am wrong in my conclusion please tell me.
[ my blog ]
Well, the normals will be pointing away from you, which could cause it to calculate a black color for that vertex, and if you are filling the backbuffer with black when you clear it, it will just blend in. Try setting the background color to white.

If that is not it, then maybe the fixed pipeline checks the direction of the normal and still culls backpointing faces? It doesn't cull when you set cullmode to NONE.
--------------------------Most of what I know came from Frank D. Luna's DirectX books
Quote:Original post by arithma
I was peculiarly addressing the fact that when I switched into CW, the mesh was rendered.. So that would mean that it should have rendered something when it was in CCW (the other side of the ship) but it didn't... If I am wrong in my conclusion please tell me.


hi arithma ,
can u put a screen shot so we could know better about ur problem and put also the code that u use to create the device and the world veiw projection matrixs u r using.

best regards,
Quote:Original post by arithma
I was peculiarly addressing the fact that when I switched into CW, the mesh was rendered.. So that would mean that it should have rendered something when it was in CCW (the other side of the ship) but it didn't... If I am wrong in my conclusion please tell me.


We don't have enough information to draw any conclusions - we could start guessing, but that wouldn't help much.

This topic is closed to new replies.

Advertisement