Facet Normal Of A Triangle: 1) Compute edge vectors using points 0, 1, 2. x10 = x1 - x0; y10 = y1 - y0; z10 = z1 - z0; x12 = x1 - x2; y12 = y1 - y2; z12 = z1 - z2; 2) Compute the cross product of the edge vectors (to recieve the normal vector). cpx = (z10 * y12) - (y10 * z12); cpy = (x10 * z12) - (z10 * x12); cpz = (y10 * x12) - (x10 * y12); 3) Normalize the result to get the unit-length facet normal. r = sqrt(cpx * cpx + cpy * cpy + cpz * cpz); nx = cpx / r; ny = cpy / r; nz = cpz / r; The Angle Between Polygons: A dot product of the facet normals (unit length) returns the cosine of the angle between the vectors. Smooth Shading: Soft Edges: Add all (normalized) normals from the common facets then renormalize the result. Hard Edges: A different normal is generated for each side. * Split a vertex and compute a different normal for each of the new vertexes. Circle Drawing: glBegin(GL_LINE_LOOP); for (i = 0; i < circle_points; i++) { angle = 2*PI*i/circle_points; glVertex2f(cos(angle), sin(angle)); } glEnd(); Normals Flipping: Negate the normal coordinates