#Texture Mapping
03-Oct-94 15:07:51
Sb: #126344-#Texture Mapping
Fm: Marion K. Marks 70700,2777
To: Chris Doner 76702,776
More on mapping coordinates:
Imagine someone mails you a picture of a logo, a model of, say, a chair, and
a letter asking you to paint the logo onto the chair model. That's all the
letter says. But you don't know how big the logo should be, or where on the
chair it should be, or in what orientation, or whether it should be painted
only once or in a repeating pattern.
3DS has the same problem if you just give it a shape and a material with
maps. It has no way of knowing HOW to apply the maps to the object.
This is what mapping coordinates are for. As I said before, there are seven
types: the three manual types (Rectangular, Cylinderical, and Spherical), the
more-automated Lofted, Box and Face mappings, plus IPAS .PXP/.AXP-modified
mapping.
Starting with the manual types: Rectangular mapping works as if one took an
insubstantial rectangular picture that was magically enchanted so that anything
it passed through would take on the colors of the picture, and you then passed
the rectangle over an object. Each pixel of the picture that intersects the
surface of the object causes that tiny spot of the object to take on that color
(or opacity or bump deformation or whatever). Another way of looking at it is
to imagine a rectangular picture wherein each pixel casts a ray of light in
both directions from it, exactly perpendicular to the rectangle itself, and
extending to infinity in both directions. Where any of these rays intercept
the mapped object(s) or element(s), they paint the surface with their
individual pixel colors.
Cylinderical mapping imagines a picture rolled up into a cylinder. This
time, think of it as rays of light being emitted from the surface of the
cylinder both inwards towards the center and outwards towards infinity, but
always perpendicular to a plane tangent to the cylinder at the point the pixel
in question. Again, any object so mapped which intersects these rays gets
painted on accordingly. Usually, a cylinderical map is positioned so that its
center and axis match up with the center and an axis of the object(s) or
element(s) to be mapped, but this need not always be the case. Interesting
mapping effects can be done by having the cylinder off-center or even
completely outside the object.
For spherical mapping, imagine the picture wrapped around a globe and
projecting its rays of colorization inwards towards the center and outwards to
infinity, with each ray being precisely perpendicular to a plane tangent to the
sphere at the pixel. Again, the center of mapping need not, but usually does,
coincide with the center of the mapped object.
You can "tile" any of the manual types, causing the picture to repeat
horizontally and/or vertically. Note that, for rectangular, the aspect ratio
of the mapping icon should be as close as possible to the aspect ration of the
picture it contains, or else the picture will appear distorted (compressed or
expanded).
Lofted mapping basically follows the loft path in the 3D Lofter and applies
coordinates to the resulting object so that the pictures appear wrapped
perfectly around the object. You can set tiling options here as well.
Box mapping is like rectangular mapping but works semi-automatically. You
simply specify a material for the Front, Back, Left, Right, Top, and Bottom of
the object (as seen from its local coordinates — to verify those, do an Object
Pivot on it from the Keyframer), and those are applied with mapping coordinates
that act as if the rectangles for each of the three dimensions were exactly
sized to precisely enclose the object, but no larger than that.
Face mapping applies mapping coordinates to each individual face or group of
coplanar faces. This is set on the material layer and overrides all other
mapping coordinates. It results in mapped patterns that completely cover the
surface, mapped to each face. The results aren't easily predictable but can be
quite beautiful. Check out the sample FACEMAP.3DS file, and apply the sample
FACEMAP METAL BUMP material to the polyhedron.
Finally, certain .PXPs and .AXPs can apply their own more sophisticated
mapping at modeling (.PXP) or rendering (.AXP) time. In the case of .AXPs, you
must first apply any arbitrary mapping coordinates (default rectangular will
work fine) to the .AXP stand-in object so that the Renderer doesn't abort with
an "Object needs mapping coordinates" error before the .AXP even gets a chance
to run. Those arbitrary coordinates will usually be completely replaced by the
IPAS-generated coordinates, though, but it may use them as a basis. For
example, DISINTEGRATE chooses the color of each particle by the dominant color
of the original mapping of the object at that point. FIREWORKS, on the other
hand, completely ignores the original coordinates and instead uses the applied
map as a time/distance color chart to control the color of each of the
fireworks particles and their tails over time.