Problems with glDrawElements()

Started by
10 comments, last by mikeathan 15 years, 8 months ago
Any time you render geometry using glBegin and glEnd, you're using something called "immediate mode." It's slow and clumsy on the GPU, but gives you control over just about everything.

When you use glDrawElements you're using vertex arrays. Normals are just a part of the "state" that makes up the OpenGL state machine, so when using immediate mode, you can change the normal state whenever and as frequently (or infrequently) as you want. Vertex arrays, however, work on a per-element basis, so you need to specify one normal/color/texcoord (depending on what clientstate you have enabled) for every vertex.
Advertisement
Hi, thanks for the replies . The problem was the normals , i loaded the normals from the file and everything is works fine now . When i was calculating the normals it was for the faces only and not for each vertex.
Thank again.!!

This topic is closed to new replies.

Advertisement