Important for gaming.

3 How useful is texture/ image mapping?
• Texture coordinates
‐ Used to identify points in the image to be mapped
• Object or World Coordinates
‐ Conceptually, where the mapping takes place
• Window/Device Coordinates
‐ Where the final image is really produced
• Parametric coordinates
‐ May be used to model curves and surfaces

In object coordinates the origin and coordinate axes remain fixed relative to an object no matter how the object’s position and orientation change.
Most mapping techniques use object coordinates.
Normally, if a teapot’s spout is painted white, the spout should remain white as the teapot flies and tumbles through space.
When using world coordinates, the pattern shifts on the object as the object moves through space.
Depending on the mapping situation, we may need to bound an object with a box, a cylinder, or a sphere. It’s often useful to transform the bounding geometry so its coordinates range between zero and one.


We consider two things: map shape and map entity.
In 2D texture mapping, we have to decide how to paste the image on to an object.
In other words, for each pixel in an object, we encounter the question, “Where do I have to look in the texture map to find the colour?”

For a map shape that’s planar, we take an (x,y,z) value from the object and throw away (project) one of the components


You can determine which component was projected by looking for color changes in coordinate directions - movement along the z-axis does not produce a change in color.
This is how you can tell that the z- component was eliminated.
This slide shows several textured-mapped objects that have a planar map shape.
None of the objects have been rotated. In this case, the component that was thrown away was the z- coordinate.


An (x,y,z) value is converted to cylindrical coordinates of (r, theta, height).
For texture mapping, we are only interested in theta and the height.
To find the color in 2D texture map, theta is converted into an x-coordinate and height is converted into a y- coordinate. This wraps the 2D texture map around the object.
The texture-mapped objects in this image have a cylindrical map shape, and the cylinder’s axis is parallel to the z-axis.





Using a box as the map shape is similar to planar mapping.
Instead of using one texture map, box mapping uses six – one each for the left, right, front, back, top and bottom sides of the object.
To texture map the front and back sides, we eliminate the z-component of an object’s point.
Use the remaining x- and y-components to locate the color in the corresponding texture maps.


Map shape takes an (x,y,z) value from the object and converts this in various ways.
The map entity determines what we use as the (x,y,z) value.
Commonly-used map entities are:
1) a point on the object relative to the object’s bounding box,
2) the surface normal at the point being rendered,
3) a vector running from the object’s centroid through the point,
4) the reflection vector at the current point. (Remember that the reflection vector depends not only on the position of the point and its normal, but on the position of the viewer.)


Technique is similar to a weather map on TV. Green Screen..
An example:
We want to place the word “hello” on top of a map of the world. The black background of the “hello” image will be treated as transparent.
To create a pixel in the final image, we find the colors in the corresponding pixel locations in the two input images and combine the two.

Procedural Textures!
• Procedural textures are textures that are defined mathematically.
• There are two general types of procedural texture:
– Those that use regular geometric patterns. – Those that use random patterns. (Random Noise)
• Combining these two types can give enhanced realism (e.g. irregular paving slabs, or weathered brickwork).

In 3D texture mapping, each point determines its color without the use of an intermediate map shape (Peachey, 1985; Perlin, 1985).
We use the (x,y,z) coordinate to compute the color directly. It’s equivalent to carving an object out of a solid substance.
Most 3D texture functions do not explicitly store a value for each (x, y, z)-coordinate, but use a procedure to compute a value based on the coordinate and thus are called procedural textures. (Algorithm)

Making a wood-grained object begins with a three-dimensional texture of concentric rings (Peachey, 1985).

• Usually, the natural look of the rendered result is achieved by the use of:


• Bump mapping is a lot like texture Mapping. However, where texture mapping added colour to a polygon, bump mapping adds, what appears to be surface roughness.
• Note – the polygon is still flat but it appears to have surface variations.

