Human Anatomy UV Coordinates Setup for Texturing
Medium Difficulty (basic prior knowledge of 3D modeling assumed)
You will need your own 3D model of a person.
If you want to put textures on to your polygonal 3D model, then you need to create a UV texture map to make sure the textures line up correctly, otherwise they will appear stretched and blurred. It is fundamentally important because you will use the same map for colour mapping, bump mapping, specular mapping, etc. and you can't change your UV map after the textures have been made because the textures rely on the position of the UV map.
Texturing a 3D object is like wrapping a present or designing clothes for a body. You need to be able to wrap one or more 2D surfaces around a 3D object without any overlaps and also with the minimum number of seams that covers the whole 3D surface. This is easy to do with a 3D box, but something as complicated as human anatomy is a lot more difficult, but is based on the same principles.
Why are they called UV coordinates? Our usual 3D coordinate system parameters are called x, y and z. The three letters before these in the alphabet are u, v and w. Textures are 2D objects so we just drop the w part and simply call them UV coordinates.
There are many ways to setup a UV map, but here is a method that has worked for me.
Step 1: Apply the temporary grid texture to the model
Given a 3D model of a human, we are now required to set it up for texturing by defining its UV coordinates. The best way to see if your UV map is lined up correctly on the 3D model is to use a temporary texture of alternately coloured squares like a checker board. This is so that we can instantly see on the 3D model where the problems appear because we know it should look like a square. I have made my own grid texture that has more colours than just black and white plus it has directional arrows to help me visualise what's going on.
I am using Maya 7 in this tutorial for demonstration purposes but the process is still the same for all 3D software.
We initially use a Planar Projection map just because it arranges the UV coordinates into a recognisable form, plus it's quick and easy. We could use a cylindrical projection but we won't be using the automated projection in the end for our UV map anyway so it doesn't really matter - we will be unfolding and working on each section independently.
Make sure you are using the Modeling menu set. Select your 3D model then go to Polygon UVs > Planar Mapping
Change to the Rendering menu set. Select your 3D model then go to Lighting/Shading > Assign New Material > Blinn. It doesn't really matter which material you pick, so long as you can use it to apply a colour texture map to your 3D model. I like to use Blinn by default for most materials because it has a Specular option for shiny effects where required.
Click on the icon where it is labelled Color and set the File texture to be the checker image as mentioned earlier.
To be able to see the texture on your 3D model, select Shading > Hardware Texturing.
Click on the place2dTexture1 tab and change the Repeat UV values to 100 or a value that shows enough squares to be able to see all the detail you need.
Close this setting window and then click on the Perp/UV button on the left hand side tool bar. Make sure you have selected the 3D model in the left window to be able to see the UV map in the right window. The UV map should look like a front view due to the planar mapping we did earlier. You should also be able to see the checker texture file in the background. Press the Dim Image button so you can see the UV lines more clearly against the background.
If you take a close look at the front and back of the 3D model, you should see that the checker texture is reasonably flat and accurate due to the planar mapping. However, looking at the sides or top or bottom of the 3D model, we can see the texture stretching, which is what we need to fix.
Step 2: Use the minimum number of seams
We need to figure out how to unwrap the surface of the 3D model so we can lay it down flat like a piece of cloth. Ideally we would like to unwrap it in one piece but that isn't possible so we need to figure out the minimum number of surfaces we can divide it into to be able to lay it out flat. This means we will need to define the location (on the 3D surface) where to make cut lines for each section. The problem that occurs when we define a cut line (also called a seam) is that the texture we draw can often be difficult to match on either side of the seam, so the seam will appear like a line on the surface where it should actually be smooth and continuous. This is the reason why we aim to use as few seams as possible.
We can't avoid using seams, so our tactic is to put them in places that are less visible, like the inside of the arms and legs. The seam line for the face is positioned around the outside rather than a vertical line between the eyes and down the nose for the same reason. For a box, you can put the seam line on an edge to hide the seam quite well, but human anatomy is mostly rounded in shape.
When defining the seams, it is easier to see where to put them by turning off the texture on the 3D model by selecting Shading > Hardware Texturing if you currently have it turned on. To create a cut (or seam line), first change to "edge select" mode (F10 key) and select a line of edges by holding down Shift and clicking on the edges. Make sure you have selected the Modeling menu set, then select Polygon UVs > Cut UVs. To reverse this action in case you make a mistake, you can join the seam back together by selecting Polygon UVs > Sew UVs.
To be able to see where the seam lines are more easily, select Display > Custom Polygon Display > (small box to the right to show options). Select the Texture Borders option then Apply and Close. You should now be able to see the seams as thicker lines.
The following images show where I have placed the seam lines. There are many different ways this can be done, but you have at least one example here. Some seams are hard to see, so to be clear: there is a seam going all the way around each ear where it joins on to the head, there are seams that go around just inside the lips, nose and eye balls and a seam that runs around the hand to each side of the wrist that splits it into a top and bottom UV sections through the middle of the fingers.
Step 3: Minimise stretching while having a recognisable map
Our next step is to unfold each of the sections we have specified. Select a vertex on the section on the 3D model that you want to unfold. Go to the UV map window and press F12 to change to UV select mode.
From the menu of this window go to Select > Select Shell. Press W on yor keyboard to change to move mode. Shift this section of UV coordinates away from the rest into a clear area. I like to arrange all the sections into a position that generally represents where they would be on the 3D model because it's easier to keep track of what sections you have completed so far (shown as the last image in Step 4).
Polygons > Unfold UVs. The unfold function will flatten out your UV texture for you. If you take a look at your 3D model again, you should see that the square texture is evenly displayed all round this section without stretching which is one main goal we are trying to achieve. This is what the unfold function does for us.
However, we still want the flat UV map to look like the place where it came from on the 3D model so that it will be easy and intuitive to paint the texture for that section. When you first unfold the hand (for example) you will probably get a result that doesn't look much like a normal hand, so although it appears flat on the 3D model, you can't really use it to paint a texture map
We need to reshape the UV map into a recognisable hand shape but still have the texture appear evenly on the 3D model. To do this, we select some key extremity UV points, one at a time (like the ends of the fingers/thumb and base corners of the palm) and shift them to where we think they should be. We then select all the other points (not any of the points we just moved) and select Polygons > Unfold UVs. By not selecting our key extremity points, we are telling the computer not to shift them. By unfolding all the rest, we are telling the computer to shift these points around to fit the new structure but because we are using the unfold function, it will unfold to a proportionately correct position to give an even texture covering.
Our other goal we are trying to achieve is to avoid the UV coordinates being overlapped. This tends to be a little difficult with each of the fingers in the hand, so we try to move outer fingers (pointer and little finger) out further to give more room for the inner fingers to avoid the overlap problem between each finger. We do this by repeating the above procedure of moving the extremity points and unfolding the inner points again. We keep repeating this until we have a shape that we are happy with.
Another goal I have seen many other people do is to reshape the UV map into a rectangular or square shape by moving ALL the border points. This is a very good way to utilise the available texture resolution so you will get the maximum visible detail from your texture appearing on the 3D model, but I personally find that it distorts the shape too much and you get texture stretching which blurs the texture too much for my liking. Basically, the more UV points you force to be in a location they aren't really supposed to be, the more texture stretching you will probably experience. Here is an example of the arm.
Step 4: Keep all sections the same scale
After unfolding and reshaping all of the UV map sections, we now need to make them all the same relative size to one another. This is so that the texture will appear evenly distributed across the whole 3D model which will also help in hiding the seams of the UV map. To get all the sections to be the same relative scale, view the checker texture on your 3D model while scaling each UV map. For example, if you have set the scale for the face UV map and are now working on the adjacent UV map of the back of the head, take a close look at the seam between these two sections on the 3D model as you scale the arm UV map. Look at the size of the checker squares and try to make them the same size.
Work your way through all the UV map sections making sure the adjacent maps have the same relative scale. Also try to make sure the squares of the checker texture are about the same size over the entire 3D model. However, the top priority is to ensure the adjacent maps are of the same scale to hide the seams as much as possible.
Step 5: Fit all sections into a square area to utilise the available texture resolution
Now that you have all the UV map sections, you need to arrange them to fit into a square shape as tightly as possible with a small amount of space between them (not too small to make it easier when painting the texture map). This is so that the sections are as large as possible so they use more texture area (hence resolution) so you will end up with a more detailed texture appearing on the 3D model. The spaces between the UV map sections are essentially wasted texture space that isn't used so you want to minimise this wastage as much as possible. This is why many people like to stretch the UV map itself into a rectangular or square area (as I mentioned earlier) so that no texture area is wasted, however, I personally don't like the stretching it can cause. When fitting the UV map sections in a tight square shape, you can only move or rotate the pieces (do not scale them one at a time). When doing this I try to keep the UV map sections that are adjacent to one another (like the neck and body) or related sections (like each arm) together. I also try to keep the orientation of each section as intuitive as possible (like the face being vertical and not sideways). This makes it easier when you go to paint the texture maps.
Once you have the UV sections into a square shape, select them all and scale them to fit the UV square background shown in the editor. You will probably need to shift the sections around to fit this exact square better. This square has x and y (u and v actually) dimensions of 0 to 1. This square shape will match the shape of the texture map. The good thing about a UV map is that it is not dependent on resolution, it's a relative scale. This is why the UV dimensions are from 0 to 1 which is essentially a percentage from 0% to 100%. You can see this range displayed in light grey on each background grid axis as 0, 0.1, 0.2, 0.3,... 0.9, 1.
You don't have to use a square texture shape, however it is far more efficient for the computer to process square texture map sizes that are a dimension of a multiple of 2 like 256x256, 512x512, 1024x1024 pixels, etc. You can also use more than one texture file too, like one for the face and another for the body, however this is usually more inefficient and harder to match the scale and colour across texture maps. It is more inefficient because arranging UV sections into multiple squares usually ends up wasting more space because you now have extra boundaries you need to fit them all around.
You have now finished the UV map! You can then create a snapshot of this map to use as a template to see where to paint your texture map. Select Polygons > UV Snapshot... and now go have some fun painting a texture for your 3D model! How do you paint textures? Well, that's another story..