Now it's time to skin the model. In Chapter 9 you learned how to create the textures for skins, and in Chapter 13 you learned how to do simple UV mapping for skins. Next, we have to do the UV mapping for the player-character, which is somewhat more complex. We are not going to go over the creation of the texture for Hero character skin. The
Resources folder includes a mapped Hero skin texture for you to use, but I encourage you to make your own in the same fashion as the one for the Standard Male.
If MilkShape is not already running, launch it and open your Hero model, located at C:\3DGPAi1\resources\ ch14\myhero.ms3d.
Choose File, Export, Wavefront Obj and export your Hero model as C:\3DGPAi1\resources\ch14\myhero.obj.
Launch UVMapper and maximize the window.
Load the C:\3DGPAi1\resources\ch14\myhero.obj. You will see a crazy quilt of lines. This is the "default" mapping created by MilkShape. Let's forget about that, because we are going to create our own mapping.
Choose Edit, New UV Map, Planar and then use the settings shown in Figure 14.64.
Figure 14.64: Planar mapping settings for Hero model.
Choose Edit, Settings, click Color by Group and then click OK. Your screen should now look like Figure 14.65.
Figure 14.65: The unwrapped Hero model.
First, choose Edit, Select All and press the forward slash ("/") key on the numeric keypad to shrink the selection to 25 percent, half-sized in the x dimension and half-sized in the y dimension (the asterisk ["*"] on the numeric keypad will do the opposite). Press Enter to save your adjustment. If you didn't like the adjustments you just made, press Esc to undo your changes since making your last selection or remapping.
Choose Edit, Select by Group, choose the group "head", and then click OK.
Choose Edit, New UV Map, Spherical. Use the Spherical Settings shown in Figure 14.66.
Figure 14.66: Settings for the spherical mapping of the head.
Press the equal sign ("=") on the numeric keypad to expand the head selection to fill the window, and then press the numeric keypad "/" a few times to shrink the selection. Use your mouse to drag the head to the upper center of the window, as shown in Figure 14.67.
Figure 14.67: The unwrapped head.
Now you might notice that there appear to be two triangles out of place in the head unwrapping. Look inside circle A in Figure 14.67 and see if you can spot them. In your model this may not be the case, but the more closely your model matches the one I've done here, the more likely this is to happen. This little oddity is easily fixed. You should be able to do the mapping without that happening—it's all a matter of which settings you use. You can try to get the right settings by trial and error. However, the simplest fix is to just move the miscreants to their lawful location. So that's what we'll do.
Drag your cursor over the middle of the two wayward triangles. Don't touch any parts of any other triangles in any other part of the model. The triangles will now appear surrounded by a selection box.
Click and drag them over to the right-hand side where there is that suspicious-looking gap, and place them as well as you can. Location B in Figure 14.68 shows where the triangles end up.
Figure 14.68: The adjusted triangles.
Use the arrow keys to adjust the position of the triangles. There you go!
Now you need to do a bit of housekeeping-like fiddling.
Choose Edit, Select, All. You will get everything on the screen selected in a selection box with the little black sizing handles at the corners and midway along each side.
Grab the sizing handle on the right side. Your cursor should change to the left-right sizing cursor (this is an arrow pointing left and right).
Drag the sizing handle toward the left until you get a blank space on the right a little wider than the width of the head.
Choose Edit, Select, Group and choose the head. Drag it over to the upper right, in the blank space you just created. You should now have a layout like Figure 14.69. As you work you will probably reorganize your layout a few times— that's perfectly normal. You want to keep it clean and make sure your items are easily selectable.
Figure 14.69: The reorganized map.
Now choose Edit, Select, By Group, and choose the LeftHand group.
Choose Edit, New UV Map, Box. You will get the Box Mapping dialog box, as shown in Figure 14.70. Make sure you have Split front/back turned off, and Gaps in Map turned on. Click OK.
Figure 14.70: The Box Mapping settings.
The unwrapped left hand will appear in the window, surrounded by the selection box.
Move and size the hand mapping, placing it in the center of the window in the blank area. Make sure it is small enough to allow the mapped right hand in here as well (see Figure 14.71).
Figure 14.71: The UV mapped hands.
Perform the same UV mapping operation and placement operation on the Right-Hand group, putting them in the center space.
Next, map the left and right feet the same way. For each group as you unwrap it, size the sole (oval shape) so that it is longer than it is wide. Place the feet underneath the main model, as shown in Figure 14.72.
Figure 14.72: The UV mapped feet.
Next, map all the arms and legs. Use Planar mapping for these.
Shrink and move the mapped objects, ensuring that no mapped objects overlap any others.
Once all the objects are mapped, overlap similar items (with the exception of the torso front and back), and enlarge the torso, hand, and head objects as much as possible. The larger the mapping, the more detail can be applied in the texture.
Finally, move and arrange the objects to match the layout in Figure 14.73. This is the final texture-mapping layout that we'll use for the template.
Figure 14.73: The final UV mapping layout.
Choose File, Save Model and save it as C:\3DGPAi1\resources\ch14\myhero.obj (thereby obliterating the one you created from MilkShape; don't worry though— you can always export another from MilkShape if needed).
Choose File, Save Texture Map and save the map as C:\3DGPAi1\resources\ ch14\myhero.bmp. Make sure the texture size is set to 512 by 512.
Launch MilkShape and create a new file.
Choose File, Import, Wavefront Obj and import the C:\3DGPAi1\resources\ ch14\ myhero.obj file.
In the Materials Tab of the toolbox, click New.
Click the top Texture button and locate the C:\3DGPAi1\resources\ch 14\myhero.bmp texture map template file you created in UVMapper.
Rename the material as "heroskin".
Using the Groups tab, select all the meshes and then switch back to the Materials tab and click Assign. You should now have a 3D view that resembles Figure 14.74.
Figure 14.74: The 3D view showing the UV template texture.
Of course, your version is in color. The lines of the triangles in the color groupings assigned in UVMapper are clearly visible. You are now in a position to go ahead and use Paint Shop Pro to create your skin for the Hero model. Refer back to Chapter 9 if you need a refresher. Make sure to save your skin as a JPG file type if you want to minimize file size. This means that you will also have to go back into MilkShape and redefine your material to point at the JPG version and not the BMP version.
We'll continue from here into the animation section using the UV template hero skin that I've included in the C:\3DGPAi1\resources\ ch14\hero.jpg file.