• Advertisement
Sign in to follow this  

glNormalPointer question

This topic is 4875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, so I am a bit confused. I know there are two types of normals...vertex normals and face normals. When using glVertexPointer, which one is it expecting? If it is the face normals, how does it know which order they are supposed to be in, in terms of the other elements of my various vertex arrays (specifically the data passed in via glVertexPointer). The whole difference between face and vertex normals and their various uses has always perplexed me a bit...

Share this post


Link to post
Share on other sites
Advertisement
Hmm, that's what I thought. So that doesn't help me solve my wierd lighting issue at all I guess. Okay, back to square one :)

Share this post


Link to post
Share on other sites
When drawing a vertex array, the same index is used for all enabled arrays, so there should be exactly one normal in the normal array for each vertex in the vertex array.

Whether you get (the effect of) face or vertex normals depends on the shading model (glShadeModel). GL_SMOOTH (default) will specify the color per vertex, and interpolate to get color values between vertices. GL_FLAT will shade the entire primitive with the same color.

edit: Oh man, that was late...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement