PDA

View Full Version : Please help how do i solve a problem



bozland
08-23-2003, 08:59 PM
Please answer me on one question. I used glDrawElement for bumpmap and this works. But when i use glDrawArray, my model looks as if i use normals of polygons rather then vertex normals. One word this looks as if i have FLAT shading rather then SMOOT. But me it is necessary to use glDrawArray for this, how i solve this problem?
Sorry for my English.

mako
08-24-2003, 07:10 AM
Can you post your rendering code? Normally, there should be no difference between glDrawElements and glDrawArrays in the final result. Did you use glNormalPointer correctly with the correct stride parameter?

bozland
08-24-2003, 09:39 AM
This that i use. If i use glEnable(GL_LIGHTING) (OGL vertex light) that this works well, but if i use bumpmap that occurs not it is correct.


glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,sizeof(Vector3D),&vertice[0]);

glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT,sizeof(Vector3D),&normals[0]);

glDrawArrays (GL_TRIANGLES,0,count);

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);