PDA

View Full Version : unusual problem with textures



mithun_daa
02-06-2004, 07:36 AM
i have a recangular polygon with textures draped on the side walls. i first draw the four side walls with textures onto it, then draw the roof and the floor of the polygon. i have saved this in a DL with my texture properties and enviroment function. when i rotate the polygon around, the front textured face (whichever face is facing the user) disappears and the other 2 ( lookin from a corner of the polygon) or 3 textured faces appear. looks like the textures are being show inside the polygon rather than outside. i tried playin with the texture co-ord and the normals to c if it works, but it doesnt. can someone tell me why this could be happening.
thank u.

dvm
02-06-2004, 08:01 AM
Somecode would be nice, my first thought goes to: have you enabled GL_DEPTH_TEST? Sometimes you can forget about it and get the weird inside out results.

mithun_daa
02-06-2004, 08:14 AM
Originally posted by moucard:
Somecode would be nice, my first thought goes to: have you enabled GL_DEPTH_TEST? Sometimes you can forget about it and get the weird inside out results.

code :

glnewlist

.....
....
glColorMaterial faceFront, cmmAmbientAndDiffuse
glEnable glcColorMaterial
glEnable glcTexture2D
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepDecal
glBindTexture glTexture2D, 200

glBegin bmQuads

glTexCoord2f 0, 0
glVertex3d dblx1, dbly1, z

glTexCoord2f 1, 0
glVertex3d dblx2, dbly2, z

glTexCoord2f 1, 1
glVertex3d dblx2, dbly2, z + sngH

glTexCoord2f 0, 1
glVertex3d dblx1, dbly1, z + sngH

glEnd

glDisable glcTexture2D
glDisable glcColorMaterial
....
draw roof
...
draw floor
....
glendlist

can anyone tell me how to attach an image with a topic? do u have to have a link to a website to show an image?

02-06-2004, 08:22 AM
How about turning cullfacing off?

mithun_daa
02-06-2004, 08:27 AM
Originally posted by can't remember:
How about turning cullfacing off?

nope, that doesnt work.