I want to render some objects using OpenGL ES 2.0 and the glDrawElements() function. The Data is parsed from an .obj File in simple flot-arrays for vertices, normals, texCoords,
when i try to render the scene i get some problems with the normals and texCoords. I’m sure that there is a problem while filling the indicies-array. For rendering I’m using the following Code:
Ok next problem appears.
I’ve organised the indicies, but when I try to render a cube, the image looks flat - but the array-values are ok. I’ve tested another program, who draw the vertices with glBufferData, and there it works fine.
What does your shader code look like (vertex shader and fragment shader)?
Also I notice you are culling the back face – are you careful in the winding direction you define the vertex indices – maybe just disable culling for a quick test. If you have wound your vertices in the “wrong” order then they should all show up once you disable culling. This will mean you need to reorder your indices