Archived

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

darkawakenings

I cant see polygons from the back!

Recommended Posts

I was just wondering if this is normal behavior, because being halfway through chapter 6 in ''programming role playing games with directX'', i can draw some funky shapes and throw textures on them. But I decided just to have some fun so I wrote a little code so that the mouse moving over the client area spins the camera around my objects. To my surprise, when I got behind some of my polygons, it was as if they werent even there. Now I can see right through them. When i move the cam back around to the front, they are there, texture and all. I was just wondering if this is normal, and if it is how I stop it. I do not want these half textures!

Share this post


Link to post
Share on other sites
Ya its normal, its called Culling i think. It just saves Processing time. What it does, is it only draws one side, so that when you create 3D objects, your only going to see the drawn side, and it doesnt have to draw the inside...
if you want it to stop doing this, i would suggest turning the D3DCULL_CW or D3DCULL_CCW to D3DCULL_NONE... that is if your using D3D

Quantum

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You need to set the render state.
YourDirect3DDevicePointerHere->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);

Now if only somebody would help me with my error in the "two quick questions" thread... :/

Share this post


Link to post
Share on other sites
Thx all, (so thats what culling is! ) Now I was just wondering how to set which side to be ''culled out''. Because In one of my examples the culling showed the wrong side face. Someone earlier told me that the culling switches every polygon or something, but it didnt make sense at the time.


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Huh? A polygon isn''t displayed if the average of the vertices are facing away from the camera. So...just spin them around.

God, I hate being a damn anonymous user lo, but I can''t register because apparently I''m already registered, but I''m not... >.<

Share this post


Link to post
Share on other sites
I dont understand what you mean by the average of the vertices, or by them facing anywhere. I thought a vertex was just a point until it was connected with other vertexs, and how does the computer decide if a square with no depth placed perpindicular to your view is facing away from you or towards you?


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What happens if you make a polygon perfectly side on, AND in this order...
1------------3
|------------|
|------------|
4------------2
But it''s side-on so it''d be like...
1/3
|
|
4/2

Share this post


Link to post
Share on other sites