PDA

View Full Version : texture problem



punky
10-14-2009, 08:46 AM
i dont use blender functions or any other functions just a light source but if i rotate the cube it looks like one side is missing, but all sides are correctly made with glVertext3f (6 sides) but if i render it seems one is missing
image link, to know better what iam talking
http://sites.google.com/site/csourcecodes/home/opengl

dletozeun
10-14-2009, 10:15 AM
Is culling enabled? If it is, specify the vertices of the invisible face in the reverse order.

punky
10-14-2009, 10:32 AM
no culling is not enabled shall i?

punky
10-14-2009, 10:36 AM
no i've forgotten to define the glShadeModel

dletozeun
10-14-2009, 10:45 AM
Apart from your problem, enabling culling is a good thing for performance reasons, but here it may increase your problem, so don't do it for the moment.

I don't understand the link between your problem and shading model.

I don't have any ideas now to solve your problem, are you sure that vertex data is valid? Try to simplify your program to isolate the problem. For example, draw each face one by one and find which one is causing trouble.

punky
10-14-2009, 10:53 AM
no u are right, it didn't fix the problem

can it be that i need to do each sinde of the cube in special order first front than left etc...

dletozeun
10-14-2009, 10:58 AM
can it be that i need to do each sinde of the cube in special order first front than left etc...

No, depth test is enabled, right?

I think it is seeing all these cubes overlapping correctly... at least seemingly. Try to do what I suggested.

punky
10-14-2009, 11:02 AM
it seems it depends on wich side is actually displayed
i use a glRotatef(rotate,0,1,0); to rotate, and i paint with the glVertext the front side first and the backside at the end of glBegin(GL_QUADS) and if it rotates and the front side wents back it become this effect wich u can see on my picture

punky
10-14-2009, 11:02 AM
no dephttest is not enabled ...

punky
10-14-2009, 11:11 AM
now its ok thnx a lot