glNormalPointer question

Started by
2 comments, last by Brother Bob 19 years, 6 months ago
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...
Matt Holmes[ aka Calefaction ]Wildfire Games - General Programmerhttp://www.wildfiregames.com
Advertisement
all gl*Pointer functions provide per vertex infomation.
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 :)
Matt Holmes[ aka Calefaction ]Wildfire Games - General Programmerhttp://www.wildfiregames.com
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...

This topic is closed to new replies.

Advertisement