Graphics Reference
In-Depth Information
image pixels for each pixel to be rendered, the texturing process becomes very
slow. One way to address this is through precomputation; we'll discuss a particu-
lar form of this precomputation, called MIP mapping, in Chapter 20.
9.7 Discussion
The main idea of this chapter is so simple that many graphics researchers tend to
not even notice it: A real-valued function on the vertices of a mesh can be extended
piecewise linearly to a real-valued function on the whole mesh, via the barycentric
coordinates on each triangle. In a triangle with vertices v i , v j , and v k , where the
values are f i , f j , and f k , the value at the point whose barycentric coordinates are
c i , c j , and c k is c i f i + c j f j + c k f k . This extension from vertices to interior is so
ingrained that it's done without mention in countless graphics papers. There are
other possible extensions from values at vertices to values on whole triangles,
some of which are discussed in Chapter 22, but this piecewise linear interpolation
dominates.
This same piecewise linear interpolation method works for functions with
other codomains (e.g., R 2 or R 3 ), as long as those codomains support the idea
of a “convex combination.” For domains that do not (like the circle, or the sphere,
or the set of 3
3 rotation matrices) there may be no reasonable way to extend the
function over triangles.
Solving problems like this interpolation from vertices in the abstract helps
avoid implementation-dependent artifacts. If we had studied the problem in the
context of interpolating values represented by 8-bit integers across the interior of
a triangle in a GPU, we might have gotten distracted by the low bit-count repre-
sentation, rather than trying to understand the general problem and then adapt the
solution to our particular constraints. This is another instance of the Approximate
the Solution principle.
One important application of piecewise linear interpolation is texture map-
ping, in which a property of a surface is associated to each vertex, and these prop-
erty values are linearly interpolated over the interiors of triangles. If the property
is “a location in a texture image,” then the interpolated values can be used to add
finely detailed variations in color to the object. Chapter 20 discusses this.
×
9.8 Exercises
Exercise 9.1: The basis functions we described in this chapter, shown in Fig-
ure 9.4(a), not only correspond to a basis for R n ,theyalso form a basis of another
vector space—a subspace of the vector space of all continuous functions on the
domain [ 1, n ] . To justify this claim, show that these functions are in fact linearly
independent as functions .
Exercise 9.2: (a) Draw a tetrahedron; pick a vertex and draw its link and its
star. Suppose v and w are distinct vertices of the tetrahedron. What is the intersec-
tion of the star of v and the star of w ?
(b) Draw an octahedron, and answer the same question when v is the top vertex
and w is the bottom one.
Exercise 9.3: Think about a mesh that contains vertices, edges, triangles, and
tetrahedra. You could call this a solid mesh rather than a surface mesh. Consider a
 
 
 
Search WWH ::




Custom Search