Skip to main content
gamedev.net
🔒 Locked

Bottom texture display ?

Started by White Scorpion Jul 9, 2004 at 7:10 PM 3 replies 900+ views
Original Post
White Scorpion
White Scorpion
Hi everyone ! I've built a little prism and something's wrong with it. Every face faces the right direction ( i.e. top face faces top, right face faces right.... etc ), so when it's rotated you see every face being at the right place and you see the texture. But the bottom face faces top, so when you view the bottom of the box, you see absolutely nothing, and when you see the top, you see the bottom face AND the top face. Anyone see what's wrong ?
White Scorpion
White Scorpion
You can see what I mean by downloading the program. http://membres.lycos.fr/tilex007/
IFooBar
IFooBar
The triangles that are dissapearing are probably winded in counter clock wise order. Any face that has CCW vertex winding will be culled out by default with d3d. you can either 1) turn culling off completely:

device->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );

2) or you can define all your vertices in clock wise order

Doing 2 would be better for you in the long run. You want culling to be on most of the time.
[size=2]aliak.net
White Scorpion
White Scorpion
Yeah but since I'm using triangle strips, it won't work. I did try though. It worked about a half of what it should :P There's a triangle that is shown as the bottom and the other triangle that faces top
White Scorpion
White Scorpion
Ok... I managed to find out how to do it but it's strange... I had to do the same thing as I did but counter-clock-wise.
I initialized the Vertices in this order: top-left, bottom-left, top-right, bottom-right... and it worked ! Why ?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.