PDA

View Full Version : glNormal?



zzapatista
02-22-2001, 06:41 PM
The red book say that you can use glNormal to break down a 20 sided object into more pieces thus making it more sphereicle. But i don't really understand what glNormal does. U can only use it on vertices or vertex's. But how do you calculate the normal at one vertex?...it's just a point. They make a call like this:
glBegin (GL_TRIANGLES);

for (i = 0, i<20; i++) {

glNormal3fv(...);
glVertex3fv(...);
glNormal3fv(...);
glVertex3fv(...);
glNormal3fv(...);
glVertex3fv(...);

glEnd();

what exactly goes glNormal() do to those points?...thanx

RandyU
02-22-2001, 08:03 PM
Normal is a vector that is orthogonal(perpendicular) to surface. You cannot calculate a normal of vertex, but you can calculate normal of triangle(using crossproduct. There is a function in glAux).
Typically normals are blended, so each vertex has its normal.
Typically for non-complex figures you can specify normal w/o calculations.
Normal is used by OpenGL to calculate diffuse and specular lighting of vertex(when it points to face of viewer, surface is bright, when it's perpendicular to viewer, diffuse and specular are 0).

Randy, http://www.geocities.com/udodenko