Making a Vehicle Skin


Okay, soup cans are cool and soup hits the spot, too. But now that lunch break is over, let's move on to something a bit more serious. Many people are going to have vehicles in their games, and the Torque Engine does quite a nice job of supporting vehicles. We'll be making our own vehicles later, but because this chapter is on creating skins, let's make a skin for some kind of vehicle.

For a bit of a tease, let's take a look at a vehicle that is already included in the Torque demo using the Show Tool.

  1. Browse to C:\3DGPAi1 and click on the Show Racing Models shortcut. This is not the same shortcut as Show Book Models.

  2. Click Load Shape.

  3. From the list, select buggy.dts, which is near the bottom.

  4. Zoom in using the navigation keys and take a gander at the buggy chassis. Pretty cool, huh? Notice that it has no wheels. In Torque we model the wheels separately, so that we can model the suspension action of the vehicle more accurately.

The Dune Buggy Diversion

Okay, okay. I knew you would want to do this, so I'll show you how to test-drive the dune buggy in-game, as long as you promise to come back here after you've tired out your driving fingers. People tend not to learn quite as well when they are pouting.

  1. Browse to C:\3DGPAi1 and click on the Run racing Demo shortcut.

  2. Click on Start Mission.

  3. In the Launch dialog box, make sure that the Multiplayer Mission box is cleared.

  4. Select Car Race Track from the mission list.

  5. Click Launch.

  6. After the game loads, have at it! You probably should switch to Chase view by pressing the Tab key—there's more to see. See Table 9.2 for the keyboard controls.

Table 9.2: Torque Racing Demo Controls

Key

Description

mouse

steering left or right

W

accelerate

S

brake

Tab

toggle from first- to third-person viewpoint

Escape

exit the game

The Runabout Skinning Procedure

Okay, now that the old adrenaline is pumping, let's get back to making skins. We're going to create a skin for a less ambitious, but still pretty cool, vehicle—the runabout. It's a fictional creation of mine that's a convergence of memories of summers spent reading Doc Savage pulp stories and memories of a classic 1936 Auburn Boattail Speedster that I saw at a car show once as a teenager.

  1. Open C:\3DGPAi1\resources\ch9\runabout.bmp in Paint Shop Pro. This file contains the UV mapping template.

    This time, I've unwrapped the object differently. If you recall, the soup can was completely unwrapped so that each individual face was lying flat. This time I unwrapped the runabout by showing only the separate objects (except the cab) from one particular view—the side or the top.

    By doing this, I can treat each of these objects as symmetrical, with the hidden side being simply a mirror image of the visible side. This is another valid technique, but it does have some pitfalls, which we will encounter. The advantage of using this approach is that it saves on image editing time, because only half of the objects' surfaces need to be given textures.

  2. Select the Pen tool (second from the bottom). Set the line color to red and the fill to transparent.

  3. Select Segment Type to be Point to Point on the Tool Options palette, as shown in Figure 9.14.

    click to expand
    Figure 9.14: Point to Point Segment Type button.

  4. Using the selected object with the thicker lines in Figure 9.15 as a guide, trace a shape around the cab triangles that cover the roof and the C-pillar. You click at a start location and then click again at each place around the cab where the object's line will change direction. Each click defines a node of the object.

    click to expand
    Figure 9.15: Tracing the cab roof.

  5. When you have made the last node of your object, click on the Object Selection tool (bottom icon of the Tools toolbar). The object will now be surrounded by a rectangle with reshaping handles (black squares).

  6. If you are not happy with the shape you've made, select it again with the Object Selection tool (if it isn't already selected), and then click the Pen tool. In the Tool Options palette in the Mode section, click on the little white arrowhead icon, which is the Edit Mode button (see Figure 9.16).

    click to expand
    Figure 9.16: Edit Mode button.

  7. Move your cursor down to your object and reshape the object by grabbing and moving the little square node handles (see Figure 9.17) that are located at the places where you clicked when creating the object—these are the nodes.

    click to expand
    Figure 9.17: Arrows indicate the editable node handles.

  8. Once you've finished, change the fill color of the object you've just created to the color of your choice, and make the line color transparent. By drawing the object in this way, you don't have the fill color obscuring your template while you trace the outline. Using red line color when you are drawing helps to differentiate between the template's black lines and the lines you are making.

  9. After you've finished with the cab roof, right-click anywhere on the drawing to deselect the object you just drew, and then set the line color back to red and the fill color back to transparent.

  10. Next, draw an outline around the entire cab template, following the outside edges. When finished, click the Object Selection tool.

  11. Set the fill of this new object to a dark green-gray color, and set the line color to transparent. The new object should now obscure both the earlier roof object plus the rest of the cab template.

  12. Select the new object with the Object Selection tool, and then choose Objects, Arrange, Send to Bottom. This will move the last object you created to be positioned underneath the first object you made that covered the roof. See Figure 9.18 to see what the before and after should look like.

    click to expand
    Figure 9.18: Before using Send to Bottom, and after using it.

  13. Next, create a new raster layer by right-clicking the Layer palette and choosing New Raster Layer. Accept the defaults and click OK in the dialog box that appears.

  14. Now find the Paint Brush tool (the seventh one down), but instead of just clicking the icon, click the little black triangle or arrow on the right side of the icon. A popup icon list will appear, from which you should select the Air Brush.

  15. Set your foreground color to be the same blue (or whatever) color you used for the cab roof.

  16. Now set your Air Brush tool options to match those in Table 9.3.

    Table 9.3: Air Brush Settings

    Setting

    Value

    Shape

    Round

    Size

    32

    Hardness

    9

    Step

    1

    Density

    100

    Thickness

    100

    Rotation

    0

    Opacity

    35

    Blend Mode

    Normal

    Rate

    5

  17. Use the Air Brush to spray over the outline of the car's body, as shown in Figure 9.19. Remember to make sure that the new raster layer you created (probably called Raster 1) is selected in the Layer palette, otherwise your airbrushing will be applied to the wrong layer.

    click to expand
    Figure 9.19: Spray-painting the body base color.

  18. Now change to a light blue foreground color, and set the Air Brush size to 16 and the opacity to 12.

  19. Spray on the accent color, as shown in Figure 9.20. When I did it, I sprayed one long line from left to right, and then I went back and used short spurts to make the line more irregular.

    click to expand
    Figure 9.20: Spray-painting the accent color.

  20. Next you'll apply a fancy racing stripe. Select the Pen tool, and change it to Drawing Mode by clicking on the little pencil icon next to the Edit Mode arrow we used earlier.

  21. Make sure that Create as vector is set in the Tool Options palette, and then select Freehand for the Segment Type, also in the Tool Options palette.

  22. Set the line color to be yellow.

  23. Draw a squiggly line, with a shape like the one in Figure 9.21, from left to right on the car body. You can edit the shape of the line by twiddling the node handles, just like you did earlier when we made the cab roof. To make your line look more like Figure 9.21, choose the Object Selection tool, and deselect the line.

click to expand
Figure 9.21: Adding the racing stripe.

So, there you have it—the car's body paint job is done. Notice that we used a different approach than we did with the cab. It just goes to show that there's more than one way to skin a cater, car! I meant car! Honest.

Well, I guess it's time to get back to work. The last bits left are the four wheel-well, fender thingies. We'll do these in a fashion similar to the way we did the cab.

  1. Using Figure 9.22 as a reference and using the Pen tool set to Point to Point Segment Type, draw an outline of the upper part of the upper-left fender thingy and fill it with the basic blue we've been using.

    click to expand
    Figure 9.22: The fender thingies.

  2. After creating the last node, choose the Object Selection tool and make sure the object you just made is selected.

  3. Choose Edit, Copy to copy the object to the Clipboard.

  4. Choose Edit, Paste, Paste As New Layer. The new object will be pasted in its own layer.

  5. Choose Image, Mirror. This will cause your new object to face left instead of right, or vice versa. This is why I used Paste as New Layer, instead of Paste as New Vector Selection. When you use the Image, Mirror menu or the Image, Flip menu, all the objects on the current layer are affected. By creating a new layer with just the one object, you avoid this problem.

  6. Place your new copy of the object over the upper-right fender thingy template, adjusting it with the Pen tool in edit mode if necessary.

  7. Repeat steps 24 to 29 for the bottom two fenders.

  8. Now repeat all of steps 24 to 30, but this time create the fender skirts with a fill color of yellow, which stylishly matches the racing stripe.

  9. When you are finished, save your file one final time as C:\3DGPAi1\resources\ch9\myauto.psp. This is your source file.

  10. Now save your skin as C:\3DGPAi1\resources\ch9\myauto.jpg.

  11. Once again, you will get an alert saying that the software will have to save the file as a merged image, and asking if you want to continue. Choose Yes.

Testing the Runabout Skin

Now it's time to take our little creation out for a spin around the block, so to speak. We'll use the Show Tool just like we did with the soup can.

  1. Browse your way to C:\3DGPAi1 and then double-click on the Show Book Models shortcut.

  2. The Torque Engine will fire up the Show Tool. Click on Load Model.

  3. Find myauto.dts and load it. A fine job, indeed! Notice the lack of wheels, the same as with the dune buggy you looked at earlier.

  4. Don't forget to use the navigation keys to move the car back and forth, and rotate it about the various axes. See Table 9.1 for the Show Tool key commands.

  5. You can view my original runabout skin by loading the runabout.dts model.

Unfortunately, we'll have to wait until the later modeling chapters before we can take the runabout out for a real test drive. That's okay, though—we've plenty to do in the meantime!




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