Mapping the surface

Barycentric coordinates provide a simple and efficient method for linearly interpolating values across a triangle. The simplest case is the propagation of RGB values. Suppose RGB values are calculated at the three triangle vertices using the shading methods of Section 7.1. This results in values $ (R_i,G_i,B_i)$ for each $ i$ from $ 1$ to $ 3$. For a point $ p$ in the triangle with barycentric coordinates $ (\alpha_1,\alpha_2,\alpha_3)$, the RGB values for the interior points are calculated as

\begin{displaymath}\begin{array}{l} R = \alpha_1 R_1 + \alpha_2 R_2 + \alpha_3 R...
... B = \alpha_1 B_1 + \alpha_2 B_2 + \alpha_3 B_3 . \end{array}\end{displaymath} (7.13)

Figure 7.8: Texture mapping: A simple pattern or an entire image can be mapped across the triangles and then rendered in the image to provide much more detail than provided by the triangles in the model. (Figure from Wikipedia.)
\begin{figure}\centerline{\psfig{file=figs/texturemap.eps,width=4.0truein}}\end{figure}

The object need not maintain the same properties over an entire triangular patch. With texture mapping, a repeating pattern, such as tiles or stripes can be propagated over the surface [41]; see Figure 7.8. More generally, any digital picture can be mapped onto the patch. The barycentric coordinates reference a point inside of the image to be used to influence a pixel. The picture or ``texture'' is treated as if it were painted onto the triangle; the lighting and reflectance properties are additionally taken into account for shading the object.

Figure 7.9: Bump mapping: By artificially altering the surface normals, the shading algorithms produce an effect that looks like a rough surface. (Figure by Brian Vibber.)
\begin{figure}\centerline{\psfig{file=figs/bumpmap.ps,width=\columnwidth}}\end{figure}

Another possibility is normal mapping, which alters the shading process by allowing the surface normal to be artificially varied over the triangle, even though geometrically it is impossible. Recall from Section 7.1 that the normal is used in the shading models. By allowing it to vary, simulated curvature can be given to an object. An important case of normal mapping is called bump mapping, which makes a flat surface look rough by irregularly perturbing the normals. If the normals appear to have texture, then the surface will look rough after shading is computed.

Steven M LaValle 2016-12-31