Hi!
I made an application that read a heightmap from an image. the heightmap was represented by calling lots of times glVertex3f()…
here I show the result:
http://img17.imageshack.us/img17/9341/withoutvbo.jpg
I have rewrote the application using VBO but I’m having some trouble beacuse the render is not correct:
http://img147.imageshack.us/img147/9003/withvbo.jpg
but when I change the polygon mode to GL_POINTS I can see better results:
http://img21.imageshack.us/img21/7040/withvbopoints.jpg
The application computes the index array for the triangles and the normals.
where could be the reason of this problem?
Thanks in advance
I add my draw function:
float shininess = 15.0f;
float diffuseColor[3] = {0.929524f, 0.796542f, 0.178823f};
float specularColor[4] = {1.00000f, 0.980392f, 0.549020f, 1.0f};
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specularColor);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glColor3fv(diffuseColor);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glDrawElements(GL_TRIANGLE_STRIP, mIndexCount, GL_UNSIGNED_SHORT, NULL);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);