PDA

View Full Version : Understanding glNormal



xorserq
04-26-2014, 07:28 AM
Let's say that there's a vertex which is a part of a triangle, and part of a quad. To my best understanding, the normal of that vertex is the average of the normal of the quad and the normal of the triangle, right?
Let's also assume that the triangle is drawn before the quad. When should I call glNormal and with what vector?
Should I call glNormal 2 times, each time with the same vector (the average normal vector)?
Or should I call glNormal the last time the vertex is drawn with the average normal vector?

Agent D
04-26-2014, 08:27 AM
Your vertices are discrete sample points of a complex surface. Normal vectors are set for each vertex. In your case, you have to set an apropriate normal vector before every glVertex call. What value you pass is arbitrary. For a simple rectangular area, you might want the normals to point into the same directions, namely the normal vector of the plane.