![]() |
![]() |
Home > Tutorials >3d Studio Max Rolling Stock Tutorial
3D Studio Max Rolling Stock TutorialIn this tutorial you will learn how to create a box and texture it, add the required attachment points, export it and then create the config.txt file. The methods used to create the flatcar can be adapted to any Trainz rolling stock item. Note. To complete this tutorial you will need to download the sample texture here. 3DStudio Max will be referred to as 3ds.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
To complete these tutorials with the dimensions listed herein you will
need the following setup |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. Create a box. The first thing you need to do is create a box. At this point the size of the box does not matter.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 1 Box tool
Figure 2 Box
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. Resize the box Once you have created the box we need to resize it. You will need to select the box and then switch to the "Modify" panel. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 3 Modify menu with the box selected
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| For the box you will need to enter the following dimensions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 4 Results after resizing
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
4. Converting to mesh (Optional) The next step is to convert the body to an editable mesh object we do this by selecting the object and right clicking which then opens a context menu as shown in figure 5. Select the "Convert to Editable Mesh" entry. This is not required to complete the tutorial but if the box requires further editing or reshaping then you will need to convert the object to an editable mesh.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 5 Converting to Editable Mesh
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
5. Relocating Select the main body (Box1) and then select the move tool from the main tool button menu and type the following dimensions into the co-ordinate boxes. These boxes are located at the bottom of the 3d Studio Max window. You can also right click the "Move tool" and type them in the "Absolute World" section of the "Transform Type-in" window.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 6 Move tool
Figure 7 Co-ordinate boxes |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6.Applying Textures We can now apply the textures to the main body. To do this we need to open the "Material Editor". Select the Material editor icon and the "Material Editor" will appear. Select the first globe and then expand the "Maps" menu. Find the entry "Diffuse Color" click on the corresponding "None" item. A new window will open called the "Material/Map Browser". You will see a list of items with a green parallelogram icon Double click the "Bitmap" entry. This will open a "Select Bitmap Image File" dialog box. You will need to find and select the "Tutorial.tga" file. (You may need to change the file type to view tga files)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 8 Material Editor Icon
Figure 9 Material Editor showing the globes at the top
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
When you have completed the texture loading select the first globe and drag it to the main body. In order for the textures to show up in the window select the blue and white cube in the "Material Editor".
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
7. Adding an "Unwrap UVW" modifier Now that we have applied the texture to the main body we need to map the texture to the correct location. To do this we need to add an "Unwrap UVW" modifier to the main body. To add the modifier you need to select the main body and then go to the modify list in the modify menu. You may have to scroll down to find the "Unwrap UVW" modifier
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 10 Applying the Unwrap UVW modifier
Figure 11 Effect after adding the Unwrap UVW modifier
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
After you have applied the modifier expand the "Unwrap UVW" in the "Modifier List" and select the "Select Face" entry. Select the top of the main body and click on "Planar Map" and then click on "Edit" in the "Parameters" section of the "Unwrap UVW". A new window will appear called the "Edit UVW"
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 12 Select face
Figure 13 Face selected ready for mapping.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Now that we have a face selected and the "Edit UVW" window open you will see the screen in figure 14. If the texture in the background is wrong then you will need to change the map. To do this select the correct map from the drop down box on the top tool button bar.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 14 Face map ready for aligning
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
To make it easier to align the textures to the main frame correctly we need to change the size of the map. To do this select "Show Options" in the bottom right of the Mapping window. Then under "Bitmap Options" select the "Use Custom Bitmap Size" option and change the width and height to the size of the file which in this case is 256 x 256. Make sure the "Use Custom Bitmap Size" checkbox is checked.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 15 Using custom map size.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
While the top face of the main body is still selected we need to normalize the map. To do this select the "Normal Mapping..." from the "Mapping" menu. When the "Normal Mapping" box appears select the "Top/Bottom Mapping" from the drop down box and click OK. This will allow us to detach the top face of the main body from the rest of the mapping.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 16 Normal mapping from the Mapping menu
Figure 17 Normal mapping dialog box.
Figure 18 Freeform Mode.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Before proceeding any further we need to make sure the "Freeform Mode" icon is selected. Place the cursor over the selected map and move it to one side. Then select the rest of the mapping and move it to one side. You can also use the "Filter Selected Faces" icon to hide the other mapping but I prefer to leave all maps visible that way you don't apply the same texture area to two different mesh areas. Now we need to adjust the mapping to suit the texture. To resize the map place the cursor over the corner of the map and a triangle shaped cursor should appear. You can now drag the corner of the map down or up to the correct size. Place the texture as shown in figure 20. Continue selecting faces and moving and or resizing maps until you are happy with the locations and you have a result similar to figure 21. You will need to repeat this for each side. NOTE The texture map outlines may be a different color in your version of 3ds
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 19 Filter selected faces.
Figure 20 Adjusting and relocating maps
Figure 21 Final mapping results.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8. Alternative mapping method There is an alternative method that is available in 3ds and that is to select the entire main body and use the "Flatten Mapping" option from the menu. This will separate each face and allow you to resize and relocate them without having to use the "Normal Mapping" tool for each face. Depending on the type and shape of the object will decide the tool you use for the separation of maps. Trial and error is the only way to find the best method in some circumstances. Control-Z will undo any changes you have made that you are not happy with.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 22 Alternative Flatten Mapping tool
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9. Adding the attachment points Now that the body of the flatcar is created and textured we need to add the attachment points for the bogeys and to show Trainz where each end of the flatcar is. When adding the attachment points it is recommended to switch to the "Top" view. To add a "Point" item in 3ds you need to go to the "Create" tab and then to the "Helpers" tab. You will need to add four attachment points. Name them and move them as follows
The naming of these attachment points is critical and all of them must be included on the model.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 23 Top view
Figure 24 Point menu item
Figure 25 Finished flatcar with attachment points
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10. Exporting Once you have completed the mesh then we need to export it to the Trainz format. Deselect everything and select "Export" from the file menu. Type in a name with the .im extension. Then select the "Trainz format [*.IM,*.KIN,*.PM]" entry from the file type drop box and click "Save".
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Figure 26 File name dialog box
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
11a. Config.txt creation Once you have the flatcar exported and the directory created in the custom folder* we need to create the config.txt file and enter the following text *See the Rolling Stock File Folder Tutorial |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
The next step is to see if the flatcar shows up in Trainz. If you have created the folders correctly and entered the correct entries into the config.txt file and the level of detail file then the flatcar should show up in driver.
NOTE: If you are copying and pasting from this tutorial then please make sure the quotes are correctly formatted. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
11b. Config.txt creation with LOD support (Optional) Once you have the flatcar exported and the directory created in the custom folder* we need to create the config.txt file and enter the following text
12. Tutorial_body.lm.txt creation Now that you have created a config file for the flatcar you will now need to create a level of detail file for the flatcar.
13. LOD mesh creation Now that you have the main mesh created and the config and LOD text file created we need to create the other three meshes that are referenced in the Tutorial_body.lm. Rexport the mesh and this time use Tutorial_body_med.im as the filename.Repeat the proceedure for Tutorial_body_low.im and Tutorial_body_lowest.im. These are the different level meshes that will be displayed at varying view distances in TRS2004. Usually they would not use the same original mesh however for this tutorial it is sufficient to use the one mesh. There are a few things that can cause problems with LOD setups. One is the attachment points must be named the same, be located the same and be oriented the same for each mesh. Failure to do so can either cause the mesh to not show up at all or cause attached effects to not show up such as coronas.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Was this tutorial helpful? Not enough or too much detail? Points not explained properly? Suggest any improvements? Please use the Tutorial Enquiry Form Download this tutorial here as a PDF document. |
Trainz and Trainz Railroad Simulator are trademarks of AuranBest viewed at 1024 x 768 or higher Pages best viewed with Cooper and Cooper Black font installed. Copyright © 2007
P. Campbell. All rights reserved. Revised:
June 13, 2007
|