Texturing a 3D model, UV Mapping and Unwrapping copyright Giulio Porta 5/9/2003

UV mapping is a general solution to the problems encountered when trying to map 2D data (bitmaps) onto a 3D surface.

U and V are virtual coordinates with U representing the horizontal component of an image or the x component of a 2D function, and V representing the vertical component of an image or the y component of a 2D function. Although U and V are horizontal and vertical components of a 2D source, when mapped to a 3D object their orientation and exact position can be changed by rotation and scale.

UV mapping takes 3D geometry and assigns 3D points across the surface of the geometry to specific U and V coordinates using algorithms which either flatten or unfold the 3D geometry to make a 2D map. When the surface is rendered, the x and y values for a 2D procedural shader or the horizontal and vertical coordinates of pixels in an image map can be determined by interpolating the values from the UV map for the corresponding points on the 3D surface.

All major 3D programs have what is known as UV coordinate mapping tools. These tools will allow the texture to be applied in a planar, cylindrical, spherical, or box like manner so the texture can fit properly onto a model.

Planar projection 

The 4 X 4 squares plane represents the texture to be mapped.

The planar projection works well for flat surfaces, not of curved surfaces, as you can see here on the cylinder as it surface curves away from the front the projected map will stretch and distort.

Cylindrical projection 

The 4 X 4 squares plane represents the texture to be mapped.

The cylindrical projection works well for cylindrical shapes, cans bottles columns and the like, as you can see here on the right. The bitmap can be repeated or tiled to avoid excessive stretching.

Cubic projection 

The 4 X 4 squares plane represents the texture to be mapped.

The cylindrical projection works well for cubes or boxy surfaces, not of curved surfaces, as you can see here on the the right the top of the cylinder maps well but not the curved portion.

Spherical projection 

The 4 X 4 squares plane represents the texture to be mapped.

The spherical projection works well for spheres, balls, some fruits, rarely for anything else.

 

In order to avoid the stretching a texture will be subject to when mapped, or wrapped around an object, the texture can be repeated (tilted) a number of times along it UV coordinated. This is helpful in mapping walls, floors and terrains.

The texture here to the right was repeated 10 times both along the U and the V coordinates.

Flattening or Unwrapping

In order to avoid bitmap fitting problems the model can be flatten using a separate programs, plug-ins, or special tools that may come with a 3D program. This process is known as UV Unwrapping or flattening.

The idea behind this approach is to allow you to paint, or apply a texture, on a flat 2D version of a 3D model. By painting on a flatten mesh you'll feel more like painter painting on a canvas and you'll have more control.

Even though there are several other ways to texture a model, without flatting it, such as using a program's particular UV projection tools or 3D brushes and pricey 3D painting programs. When facing the mapping of a complex form, a forms that deviates from that of a cube, cylinder or sphere, UV projection tool will also come in handy in determining how a model will be UNWRAPPED

A cube for instance is made out of six faces, imagine it was made out of cardboard and you took a knife and cut along its corners so to unravel or unwrap the six faces of the cube onto a flat surface. The result would be a flat cruciform shape as you can see here to your right.

Once a model is flatten, that image can be save as a bitmap, either as a screen capture or in a bitmap format like a .BMP or other, and loaded into a 2D painting program. There, the image is painted using  typical 2D tools, then saved in a bitmap format that your 3D program can read and applied to the flatten version of your 3D model in the 3D program you started out with.

 

Face 6 is the bottom of the cube.

Unwrapped box

The figure here to the right was Unwrapped with UV Mapper

The Planar unwrapping splits the figure in half, front and back. 

This image generated by flattening can be saved as a bitmap and taken in a painting program like Photoshop, where  bitmaps simulating skins are painted and brought back in to the 3D program where the 3D model was created so it can be applied to it.

Painting human skins, clothing or any textures for that matter is an art form. Read this tutorial on how to simulate human skin.

This process of texture creation can begin with the manipulation of digital photos.

The Cubic or Box unwrapping splits the figure in six views, this can be useful for painting areas like top of a head of the bottom of a pair of feet.
The Cylindrical unwrapping is primarily indented for cylindrical models like columns, flash lights, and the like.

 It will work well for a human head but nor for a complete human figure in particular for arms and legs, they will have to be unwrapped separetely.

The Spherical unwrapping is for balls, planets, but not very suitable for a complete human figure  

A complex model like the human figure cannot be unwrapped all at once from head to toes, without distortions of some of the anatomy. To avoid those,  unwrapping and the subsequent application of the various bitmap  is done on pieces of the mesh at the time.

 

 

trueSpace 6 has unwrapping capabilities. A model can be unwrapped according to UV coordinates, in the illustration here to the right, the model can be seen unwrapped cylindrically.

 

 

Painting on the flatten mesh
  • The flat mesh can be exported in a painting program as a bitmap, usually by the means of a screen capture. In the painting program the screen capture is used as stencil from which the final images that will be applied to the model are painted. This is the step that requires real talent, digital painting abilities, and the knowledge of  painting programs like Adobe Photoshop, Paint Shop Pro, Corel Photo Paint and the like.
  • The last step involves importing these images back in the 3D program for application to the model. 
If the software that you are using does not have UV unwrapping or flattening tools, these are stand alone and plug-ins programs that will unwrap a 3D model for you. 

UV Mapper

http://www.unwrap3d.com/  

UV Cow

Deep UV

You may find several tutorial on the Web about this important subject, but they are usually not very thorough in particular in the actual painting techniques involved in preparing these maps. 

Some of the best and most complete tutorials involving a step by step approach concerning how to paint and blend texture maps can be found in two awesome books: Dan Ablan, LightWave 7 and Bill Flemings, 3D Creature Workshop. 

Here are some excellent web tutorials about texture mapping and texture creation. I recommend them highly.