Original Post
This is more a math question than anything else, but I figured I might as you guys since it''s a graphics question too. I''m writing a raytracer with OpenGL, and I''m trying to do Phong illumination for polygons. This means I have to tally the normals for each polygon and average them according to where I''m at on the polygon. Does anyone know the math behind doing this?
Note that I''m not just averaging one surface normal for the whole polygon -- the normal is dynamic depending on the specific location you''re rendering on the surface.
Any help greatly appreciated! Thanks!