The Hero Skin


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.

  1. If MilkShape is not already running, launch it and open your Hero model, located at C:\3DGPAi1\resources\ ch14\myhero.ms3d.

  2. Choose File, Export, Wavefront Obj and export your Hero model as C:\3DGPAi1\resources\ch14\myhero.obj.

  3. Launch UVMapper and maximize the window.

  4. 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.

  5. Choose Edit, New UV Map, Planar and then use the settings shown in Figure 14.64.

    click to expand
    Figure 14.64: Planar mapping settings for Hero model.

  6. Choose Edit, Settings, click Color by Group and then click OK. Your screen should now look like Figure 14.65.

    click to expand
    Figure 14.65: The unwrapped Hero model.

  7. 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.

  8. Choose Edit, Select by Group, choose the group "head", and then click OK.

  9. Choose Edit, New UV Map, Spherical. Use the Spherical Settings shown in Figure 14.66.

    click to expand
    Figure 14.66: Settings for the spherical mapping of the head.

  10. 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.

    click to expand
    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.

  11. 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.

  12. 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.

    click to expand
    Figure 14.68: The adjusted triangles.

  13. 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.

  14. 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.

  15. 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).

  16. 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.

  17. 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.

    click to expand
    Figure 14.69: The reorganized map.

  18. Now choose Edit, Select, By Group, and choose the LeftHand group.

  19. 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.

    click to expand
    Figure 14.70: The Box Mapping settings.

    The unwrapped left hand will appear in the window, surrounded by the selection box.

  20. 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).

    click to expand
    Figure 14.71: The UV mapped hands.

  21. Perform the same UV mapping operation and placement operation on the Right-Hand group, putting them in the center space.

  22. 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.

    click to expand
    Figure 14.72: The UV mapped feet.

  23. Next, map all the arms and legs. Use Planar mapping for these.

  24. Shrink and move the mapped objects, ensuring that no mapped objects overlap any others.

  25. 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.

  26. 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.

    click to expand
    Figure 14.73: The final UV mapping layout.

  27. 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).

  28. 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.

  29. Launch MilkShape and create a new file.

  30. Choose File, Import, Wavefront Obj and import the C:\3DGPAi1\resources\ ch14\ myhero.obj file.

  31. In the Materials Tab of the toolbox, click New.

  32. Click the top Texture button and locate the C:\3DGPAi1\resources\ch 14\myhero.bmp texture map template file you created in UVMapper.

  33. Rename the material as "heroskin".

  34. 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.

click to expand
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.




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net