C481 B581 Computer Graphics
Dana Vrajitoru

The Phong Model (cont)

Distance Term in the Phong Model

The Angle Between 2 Vectors

The Normal Vector

Computing the Normal Vector
For a triangle defined by P1(x1, y1, z1), P2(x2, y2, z2), and P3(x3, y3, z3), and i=(1,0,0), j=(0,1,0), k=(0,0,1):

Normals for a Triangle Strip

Examples of the Normal Vector

Normal for a Parametric Surface

Normal for an Implicit Surface

For any surface defined implicitly by F(x, y, z) = c (constant), we can compute the normal to this surface using the gradient of the function F:

For a sphere: F(x, y, z) = x2 + y2 + z2 = 1
The gradient of the function is (2x, 2y, 2z). If we normalize it, we obtain (x, y, z).