lawn and the sky. In actuality the wall was modeled Teaching Texture Mapping as a rectangular solid, and the lawn and the sky were Visually created from rectangles. The entire image contains eight polygons.Imagine the number of polygon it Rosalee Wolfe would require to model the blades of grass in the DePaul University lawn! Texture mapping creates the appearance of wolfe@cs.depaul.edu grass without the cost of rendering thousands of polygons. Visually demonstrating the behavior of texture mapping is beneficial to both computer science and 3: Knowing the difference art students. For computer science students it can between world coordinates serve as prelude to delving into the mathematical and object coordinates is underpinnings of the topic, while in an art class it can important when using be the main vehicle of explanation for students mapping techniques. In learning to use a rendering package as a medium of object coordinates the creative expression. The SIGGRAPH 97 Education origin and coordinate axes Slide set covers not only the techniques of two- and remain fixed relative to an object no matter how the three-dimensional texture mapping, but procedural object’s position and orientation change. Most textures, bump mapping, and environment mapping mapping techniques use object coordinates. as well. In addition it discusses aliasing in texture Normally, if a teapot’s spout is painted yellow, the mapping, and what can be done to counteract it. spout should remain yellow as the teapot flies and tumbles through space. When using world The following is a reprint of an article that appeared coordinates, the pattern shifts on the object as the in the November 1997 issue of Computer Grapics and object moves through space. contains thumbnails and accompanying narrative for the slide set. To order the full color 35mm slide set, 4: Depending on the call ACM Member Services at 800 342 6626 in the U.S. mapping situation, we may and Canada, and +1 212 626 0500 for the greater New need to bound an object York area and all other countries. The ACM order with a box, a cylinder, or a number of the education slide set is 434975 (ISBN 0 sphere. It’s often useful to 89791 956-4) and the price is $35.00 for transform the bounding ACM/ SIGGRAPH members and $45 for non- geometry so its coordinates members. range between zero and one. Transformed bounding boxes have coordinates that range from (0,0,0) to (1,1,1). For a bounding cylinder, we set the circumference to one and the height to one. For a sphere, we scale the latitude and the longitude so that 1. Mapping techniques they both range between zero and one. add realism and interest to computer graphics 5: Texture mapping can be images. Texture mapping divided into two- applies a pattern of color dimensional and three- to an object. Bump dimensional techniques. mapping alters the Two-dimensional surface of an object so that it appears rough, dented techniques place a two- or pitted. In this example, the umbrella, background, dimensional (flat) image beachball and beach blanket have texture maps. The onto an object using methods similar to pasting sand has been bump mapped. These and other wallpaper onto an object. Three-dimensional mapping techniques are the subject of this slide set. techniques are analogous to carving the object from a block of marble. 2: When creating image detail, it is cheaper to employ mapping techniques that it is to use myriads of tiny polygons. The image on the right portrays a brick wall, a
6: Two-dimensional component was projected? In the right image, which mappings use pre- component was projected? existing images. This slide shows some images that might be used for 11: A second shape used texture mapping. The in texture mapping is a images on the left are cylinder. An ( x,y,z ) value either scanned photographs or images created in a is converted to cylindrical paint or drawing package. POVRay, a raytracer, coordinates of ( r, theta, created the images on the right. height ). For texture mapping, we are only 7: In two-dimensional interested in theta and the heigh t. To find the color texture mapping, we in two-dimensional texture map, theta is converted have to decide how to into an x -coordinate and height is converted into a y - paste the image on to an coordinate. This wraps the two-dimensional texture object. In other words, map around the object. for each pixel in an object, we encounter the 12: The texture-mapped question, “ Where do I have to look in the texture map objects in this image have to find the color?” To answer this question, we a cylindrical map shape, consider two things: map shape and map entity. and the cylinder’s axis is parallel to the z -axis. At 8: We’ll discuss map the smallest z -position on shapes first. For a map each object, note that the shape that’s planar, we squares of the texture pattern become squeezed into take an ( x,y,z ) value from “ pie slices” . This phenomenon occurs at the greatest z the object and throw position as well. When the cylinder’s axis is parallel away (project) one of the to the z -axis, you’ll see “ pie slices” radiating out along components, which the x - and y - axes. leaves us with a two-dimensional (planar) coordinate. We use the planar coordinate to look up the color in 13:On the left squares of the texture map. the texture map are squeezed into pie slices 9: This slide shows that radiate out along the several textured-mapped x - and z -axes. Which objects that have a planar coordinate axis is parallel map shape. None of the to the cylinder’s axis? objects have been rotated. In this case, the component that was thrown away was the z -coordinate. You can determine which component was projected by 14: When using a sphere looking for color changes in coordinate directions. as the map shape, the When moving parallel to the x -axis, an object’s color ( x,y,z ) value of a point is changes. When moving up and down along the y - converted into spherical axis, the object’s color also changes. However, coordinates. For movement along the z -axis does not produce a change purposes of texture in color. This is how you can tell that the z - mapping, we keep just component was eliminated. the latitude and the longitude information. To find the color in the texture map, the latitude is converted 10: In the left image, an into an x -coordinate and the longitude is converted objects color changes into a y -coordinate. when there’s a change in y , or when there’s a change in z , but the color remains constant when x changes. Which 2
15: The objects have a 20: Here’s another six map shape of a sphere, textures. This scene was and the poles of the modeled by Steve van sphere are parallel to the der Burg. y -axis. At the object’s “ North Pole” and “ South Pole” , the squares of the texture map become squeezed into pie-wedge shapes. Compare this slide to slide 12 which has a map shape of a cylinder. Both map shapes have the pie-wedge 21: Here’s the result. shapes at the poles, but there is a subtle difference at the object’s “ equator” . The spherical mapping stretches the squares in the texture map near the equator, and squeezes the squares as the longitude reaches a pole. 16: These objects have a spherical map shape. 22: Remember that we choose a map shape and a map entity when texture mapping. When discussing map shape, we talked about taking an ( x,y,z ) value from the object and converting in various ways, but we didn’t mention what that value was. The map entity determines what we use as the ( x,y,z ) value. Commonly-used map entities are 1) a point on the 17: Using a box as the object relative to the object’s bounding box, 2) the map shape is similar to surface normal at the point being rendered, 3) a vector planar mapping. Instead running from the object’s centroid through the point, of using one texture map, and 4) the reflection vector at the current point. box mapping uses six -- Remember that the reflection vector depends not only one each for the left, on the position of the point and its normal, but on the right, front, back, top and position of the viewer. bottom sides of the object. To texture map the front and back sides, we eliminate the z -component of an 23: This next sequence of object’s point and use the remaining x - and y - slides shows the components to locate the color in the corresponding interaction of map shape texture maps. and map parameter. The map shape is the same 18: Here are six textures for all the teapots on this that we will use in our slide. What is it? next example. 24: Some combinations of map shape and map parameter produce more 19: The objects in slide useful results than others. have a box as the map For a cylindrical map shape. shape, which map parameters seem to produce the best results? 3
Recommend
More recommend