# OpenGL ES Faces appear to be transparent when alpha is 1.0?

I am working on an object (OBJ File) loader for my app on iOS, currently I have successfully read the vertices and the faces of the object, and I am now just adding colours to the imported models.

I am coming across a major problem now. Out of a cube with six faces, all coloured red apart from two opposite faces which are coloured blue. This cube is set to rotate so I can see all sides, but the colours do not appear correctly as shown in the video below:

http://youtu.be/0L2AIFkd2Qk

The blue faces only shows when the two blue sections overlap, I cannot figure out why - I am used to OpenGL for PC, is there something I am missing which is causing this strange colouring?

The colouring is achieved by sending a large float array of the format RGBA RGBA RGBA etc for each vertex;

// colours is the name of the array of floats
glColorPointer(colorStride, GL_FLOAT, 0, colors);
glEnableClientState(GL_COLOR_ARRAY);
glDrawArrays(renderStyle, 0, vertexCount);


Any help you can offer would be great,

[EDIT]

Even if you don't know the problem, but have seen this before and know what it may be that would help as I have no idea where to even start looking as it is!

Many thanks

• Do you have depth buffering enabled? – Jari Komppa Sep 27 '11 at 4:38
• Thanks for your comment, I have a working program now! I did enable depth buffering, but it caused the screen to go blank - I made two changes - drew each face with a separate call to glDrawArrays. And also changed how I culled the faces :) – Paul Reed Sep 27 '11 at 19:09
• You definitely should not need to render each face separately, but if you're happy with the result, that's probably all that matters. – Jari Komppa Sep 28 '11 at 5:37
• Yes it is now causing another problem, rendering each face makes colouring the vertices difficult. This is something I will take a look at and try to solve tomorrow but I may be back on here soon! – Paul Reed Sep 28 '11 at 17:07
• @JariKomppa I looked into the issue at more detail and I have now got it drawing all faces from a single call, thanks for pointing out that it should work as it now means I can colour each vertex individually! – Paul Reed Sep 28 '11 at 19:57