Chapter 24: Custom 3D Models in T3DGM


As you have seen, T3DGM is probably the easiest development tool ever created for the creation of 3D games. Within minutes, you can have a fully functional game by following a series of steps. In this chapter, we’re going to look at some advanced features offered by T3DGM, including the capability to create new models out of the existing collection, along with the Level Editor, which as its name implies, allows us to create custom levels for our games.

You can use a 3D modeling tool such as MilkShape to create entirely new objects for T3DGM. While this is one method, there are certainly others that will take far less time. As we have already created a model in MilkShape earlier in the book, we’re going to concentrate on the other methods in this chapter.

Custom 3D Models

T3DGM ships with a large collection of 3D models that are ready for you to use, including a variety of automobiles, characters, and alien ships, to name a few. These objects are fine for a variety of projects, but if you get the desire, you can also alter their properties to create new ones to complement the existing varieties.

Open T3DGM and create a new game project. You can pick any scene you would like, as we’re really interested in changing the way the player model looks. For reference, the figures in this chapter will reflect the Driving category with City3 as the scene.

The first step is to choose the Car model from the driving category for the player. The model will look like Figure 24.1 when loaded. Click the small green arrow located in the lower-right corner of the box in which the Car model is located. You will see our first set of options (see Figure 24.2).

click to expand
Figure 24.1: The model as it appears in T3DGM.

click to expand
Figure 24.2: The first set of options.

These options allow us to choose how the model will be handled in the games we create. For a car, we will simply leave the model selected to Drive. The down arrow located next to the new options can be clicked to display a new set of options (see Figure 24.3). Click the down arrow again to display a third set of options (see Figure 24.4). Clicking again displays another set of options (see Figure 24.5), and with one last click, we can see the final set of options (see Figure 24.6). All of the options that are available to customize this model are now within our reach. We can scroll through these with the scrollbar located directly to the right of the model. Let’s move up to the first set of options, beginning with the size.

click to expand
Figure 24.3: A new set of options.

click to expand
Figure 24.4: Our third set of options.

click to expand
Figure 24.5: The fourth level of options.

click to expand
Figure 24.6: We have finally reached the last level.

As its name suggests, clicking this button will display a set of options for changing the size of the model. Dragging in any direction will immediately update the model, which is reflected in the interface (Figure 24.7 shows the model with the X direction much smaller). You can make your model much larger or smaller in an individual direction or all of them simultaneously.

click to expand
Figure 24.7: X is now smaller.

Click the Restore button to bring the object back to its normal size and then click the up arrow in the upper-left corner of the Options window to move back to the original set of options. The next step is to move the scrollbar down slightly to the next set of options, which includes a Wheels button among others. Click the Normal button located next to the Wheels button. The caption beneath the button changes to Add Wheels. Now, click the Wheels button to display the various wheels we have at our disposal (see Figure 24.8). Click the various wheels to see what they look like on the Car model. Figure 24.9 displays the wheels in the lower-right corner of the available selections.

click to expand
Figure 24.8: Several types of wheels are available for our car.

click to expand
Figure 24.9: The wheels have been changed.

You can also position the wheels relative to the bottom of the model. Back at the Options screen, click the Position button next to the Wheels and Add Wheels buttons. This provides three ways we can position the wheels. Move the wheels farther beneath the vehicle so that it appears the car is raised (see Figure 24.10).

click to expand
Figure 24.10: The vehicle appears to be raised.

Click the up arrow in the upper right of the Options window to return to the standard set of options. Use the scrollbar on the right to move down to the next set of options, which provides settings for how the model will be controlled. You can change this to keyboard, mouse, or joystick, depending on your needs. Using the scrollbar to move down to the next set of options gives us the ability to change the number of lives, speed, and strength properties of the model. Moving to the final set of options gives us the ability to change the way the model appears related to the camera.

By changing these properties, we can create entirely unique models, but we have only touched upon a few of the available options. As you already know, going back to the first set of options, we can change the model’s properties to running, flying, or driving. Click the Run checkbox to change the object. When you choose Run, the third set of options, which normally sets up the wheels, it now provides options for setting up the legs for the model. You can now add any one of the legs to the bottom of the object in place of the wheels. While this particular option does not make a great deal of sense for a car, it might come into play when you wish to alter an object that typically walks. You can also change the object to flying, which allows you to choose wings or propellers like an airplane or helicopter, another interesting way you can alter the models.

While all of these options definitely add variety, there is one final option we have yet to look at. This one alters the texture of the model, which will allow us to create models that look entirely different from the originals. We’ll use Paint Shop Pro for this, but first we need to download and install a plug-in that will allow us to open the textures, which are in the DDS format. Close T3DGM, saving first if you would like to go back later. You need to browse to the following Web site and download the DDS texture file plug-in for Photoshop: http://developer.nvidia.com/object/nv_texture_tools.html

This file works perfectly with Paint Shop Pro and can be installed by downloading and copying the file to C:\ program files/jasc software/paint shop pro/plugins (assuming you installed Paint Shop Pro to the default location). There are additional notes on the Web site that suggest you may have to add a couple of additional files to the Windows\System directory, and if needed, you can download and copy the appropriate files. Lastly, you will need to have DirectX installed. The DirectX 9 SDK is available from Microsoft freely and is a great download if you have the time. After the installation, start up Paint Shop Pro. Using the traditional File, Open menu, open the DDS file from the following directory: C:\Program Files\Dark Basic Software\The 3D Gamemaker\Objects\05Driving\2Player\Car.

There is only a single DDS file in this directory, called carm.dds. When you open the file, you will be given a message similar to that in Figure 24.11. Choose Yes from this window. The file is now open and looks something like Figure 24.12.


Figure 24.11: This will be displayed when you open the file.

click to expand
Figure 24.12: The file is displayed.

You have several options for changing these textures, using all the tools available in Paint Shop Pro. For example, you could quickly add numbers, repaint sections of the map, or paint an entirely new one. For our example, we’ll be creating an entirely new texture for the model so that we can offer a different color of the same vehicle. Choose the Freehand Selection tool from the toolbar. Next, draw a selection around the model, leaving the wheels unselected (see Figure 24.13).

click to expand
Figure 24.13: Everything is selected with the exception of the wheels.

Choose Adjust, Colors Balance, Color Balance from the Paint Shop Pro menu. A window will appear that looks like Figure 24.14. We can now move the sliders to quickly adjust the colors. For our first texture, we’ll turn the blue area into a shade of green. Adjust the sliders so that they look like Figure 24.15. Click the OK button to close the window and then choose Save As from the File menu. Make sure to choose Save As so that you do not accidentally overwrite the original version. The Save As dialog box appears, and you can choose a name of carm_green.dds. A new window will now appear that gives various options for saving the file. You can leave the defaults and click the Save button.

click to expand
Figure 24.14: The PSP Color Adjustment window.

click to expand
Figure 24.15: The sliders are adjusted appropriately.

You can now close Paint Shop Pro and reopen T3DGM. Create a game and load up the Car model. Open the options (see Figure 24.16) and click on the carm.dds filename. This opens up the Texture Select screen that looks like Figure 24.17. Click Your Own Bitmap to display a new screen (see Figure 24.18). Click the Get Texture button and browse to the appropriate location on your drive where you saved the texture (see Figure 24.19). Select the file and click the OK button. The texture is now loaded (see Figure 24.20). A small selection box is visible in the upper-left portion of the texture. Resize the selection box so that it covers the entire texture we have imported (see Figure 24.21). Click the Get Texture button, and the texture is resized to fill the entire texture area (see Figure 24.22). Click the Paste button and then click the Finish button, which is displayed immediately after you have clicked the Paste button (see Figure 24.23). Click the Update button to see the changes (see Figure 24.24).

click to expand
Figure 24.16: The options for loading a texture.

click to expand
Figure 24.17: The Texture Select screen.

click to expand
Figure 24.18: Click Your Own Bitmap.

click to expand
Figure 24.19: Browse to the location of the texture.

click to expand
Figure 24.20: Our texture is loaded.

click to expand
Figure 24.21: Resize the selection box.

click to expand
Figure 24.22: Click the Get Texture button.

click to expand
Figure 24.23: Click the Finish button.

click to expand
Figure 24.24: Click the Update button to see the change.




Awesome 3d Game Development(c) No Programming Required
Awesome 3d Game Development: No Programming Required (Charles River Media Game Development)
ISBN: 1584503254
EAN: 2147483647
Year: 2006
Pages: 168

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