World of Trainz Home Page Shop at World of Trainz Downloads Upcoming Projects Tutorials Forum About Links  
 
 

Gmax Shiny Wheel Tutorial

In this tutorial you will learn how to create an axle add the textures, map the textures and apply a shiny texture to the bogey wheels suitable for rolling stock. The methods used to create the object and apply the shiny textures can be adapted to any Trainz object.

Note. To complete this tutorial you will need to have the texture files which can be downloaded here.

To assist in the presentation of this tutorial I have changed the viewport settings to shade selected faces. This is done by selecting the text in the top left corner of the viewport and selecting "Configure..." and then selecting the "Shade selected faces" checkbox.

To complete these tutorials with the dimensions listed herin you will need the following setup
1. Open the "Preference Settings" from the "Customize" menu. Under the "General" tab set the system unit scale to 1.0 units = 1m
2 Open the "Units Setup.." form the "Customize" menu and set the units setup to Metric Meters.

1. Create cylinders.

The first thing you need to do is create 3 cylinders. At this point it does not matter what size they are.

 

Figure 1 Cylinder tool

 

Figure 2 Cylinders

 

2. Resize cylinders

Once you have created three cylinders we need to resize them. You will need to select a cylinder and then switch to the "Modify" panel.

 

Figure 3 Modify menu with one cylinder selected

 

For each of the three cylinder you will need to enter the following dimensions NOTE Dimensions will give a 36" wheel with a 4 3/4" axle.

 

Parameter Cylinder 1(Axle) Cylinder 2 (Wheel) Cylinder 3 (flange)
Radius .06 .457 .497
Height 2.2 .1 .04
Height Segments 1 1 1
Cap Segments 1 1 1
Sides 12 18 18

 

Figure 4 Results after resizing

 

For the axle I have used 12 sides as this gives a reasonably low poly count without looking too squarish. The same with the wheel and flange which is set at 18 sides. The more sides the more polygons required and more processing power to display it in Trainz.

 

3. Converting to mesh

The next step is to convert the wheel 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.

 

Figure 5 Converting to Editable Mesh

 

Now we can remove some unnecessary polygons. Select the wheel and then on the modifier list expand the "Editable Mesh" entry and select "Polygon". Then click on the top of the wheel and the entire top should be selected. Hit the delete button A message box will appear asking if you want to "Delete Isolated Vertices?" Select "Yes"

 

Figure 6 Expanded Menu

 

Figure 7 Polygons selected ready for deletion

 

After you have deleted the polys it will appear that the side of the cylinder is also partly gone and the base of the cylinder has been deleted. This is because the polygons for the sides and bases are one sided and when viewing from behind they appear to be invisible.

 

4. Rotating and moving

Select one of the cylinders and then select the rotate tool from the main tool button menu and type 90 into the Y co-ordinate which is 90º. Do this for all the cylinders.

 

Figure 8 Rotate tool

 

Now before we move the cylinders into location we need to reset the pivot point to the center of each object to do this we go to the "Hierarchy" menu and select the "Affect Pivot Only" Then select an object and click on "Center to Object". This moves the pivot point for the object to the center of the object. Do this for all the objects. Deselect the "Affect Pivot Only" when you are finished.

 

Figure 9 Hierarchy tab

 

Figure 10 Reset pivot point

 

Figure 11 Highlighted UCS icon.

 

Now we can position the cylinders. Select the move tool from the main tool button menu. Type in the following co-ordinates for each object:

Co-ordinates Cylinder 1(Axle) Cylinder 2 (Wheel) Cylinder 3 (flange)
X
0
-.755
-.705
Y
0
0
0
Z
0
0
0

 

Figure 12 Move tool

 

5.Applying Textures

Now that we have everything positioned correctly we need to attach the wheel and the flange together. To do this we select the flange and under the "Edit Geometry" section you will see "Attach". Select it and then click on the flange and then deselect the "Attach" item. Do not attach the axle yet. We can now apply the textures to the wheel and axle. To do this we need to open the "Material Editor". Select the Material editor icon and the "Material Editor" will appear. Select "New" and then in the "New Material" dialog box select the "Standard" entry. Expand the "Maps" menu. Find the entry "Diffuse Color" click on the corresponding "None" item. A new window will open called the "gmax Material Navigator". and To switch between the textures open the "gmax Material Navigator" icon. 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 "BogeyTextures.tga" file. (You may need to change the file type to view tga files).

 

Figure 13 Material Editor Icon

 

Figure 14a Material Editor with no textures

 

Figure 14b Material Editor showing Material #1

 

Figure 15 gmax Material Navigator icon

 

Figure 16 gmax Material Navigator with all textures loaded

 

Now select the "New" button and apply the "wheels.tga" texture to the "Diffuse Color" slot and the "env_metal.bmp to the "Reflection" slot. Change the value for the "Reflection" to 70. When you have completed the texture loading select the first materials globe and drag it to both the wheel and the axle. In order for the textures to show up in the window select the blue and white cube in the "Material Editor". Now that we have applied a texture to the entire wheel we need to change it so that the bogey texture is only shown on the front and rear of the wheel and the outside rim and the shiny textures to the wheel's running surface and the flanges face. To do this we need to add an "Edit Mesh" modifier to the stack.

 

Figure 17 Applying an Edit Mesh Modifier

 

We now have to select the individual faces that we want the shiny texture applied to. The easiest way to do this is to expand the "Edit Mesh" modifier and then select element. Select the wheel then change the "Edit Mesh" to polygon. Hold down the control button and select the front face of the wheel. This should deselect the wheel face. Hold down the control key and select the face of the flange, you should have the result shown in figure 16. With the polys selected  open the "Material Editor" and drag the second globe onto the selected area. Make sure you drop the texture onto the selected area only. Deselect the polys and you should have a result similar to figure 17.

 

Figure 18 Poly's selected for texturing

 

Figure 19 Result after applying the shiny texture

 

At this stage the textures on the wheel don't appear to be shiny. This is because texture effect such a reflection do not show up in the view port.

 

6. Adding an "Unwrap UVW" modifier

Now that we have applied the texture to the wheel and axle we need to map the texture to the correct location. To do this we need to add an "Unwrap UVW" modifier to both the axle and the wheel. To add the modifier you need to select an object and then go to the modify list in the modify menu. You may have to scroll down to find the "Unwrap UVW" modifier

 

Figure 20 Applying the Unwrap UVW modifier

 

After you have applied the modifier expand the "Unwrap UVW" in the "Modifier List" and select the "Select Face" entry. Then select the front face of the wheel and click on "Edit" in the "Parameters" section of the "Unwrap UVW". A new window will appear called the "Edit UVW"

 

Figure 21 Select face

 

Figure 22 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 20. 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 23 Face map selected and ready for aligning

 

Figure 24 Changing Maps

 

While the face of the wheel is still selected we need to "Detach Edge Verts". To do this right click the selected map and then select "Detach Edge Verts" . This will allow us to detach the front face of the wheel from the rest of the mapping.

 

Figure 25 Detach Edge Verts in the context menu

 

Figure 26 Map manipulation tools.

 

Before proceeding any further we need to make sure the "Move" 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 click on the corner of the map and a the corner box should turn red. You can now drag the corner of the map down or up to the correct size. Place the texture as shown in figure 19. Continue selecting faces, selecting "Planr Map" and moving resizing maps until you are happy with the locations and you have a result similar to figure 19.

NOTE The texture map outlines may be a different color in your version of Gmax

Figure 27 Filter selected faces.

 

Figure 28 Adjusting and relocating maps

 

Figure 29 Final mapping results.

 

7. Creating the second wheel.

Now that we have mapped all the textures to the correct location we can now create the second wheel. Before we do this we need to convert both items to "Editable Mesh". This will allow us to attach everything together without upsetting the mapping. Next we need to mirror the wheel from one side to the other. To do this select the "Mirror Selected Objects" icon from the main toolbar. The "Mirror World Coordinates" dialog box will appear. Select the X mirror axis and type 1.51 into the "Offset" coordinate box and select "Copy" from the "Clone Selection" section

 

Figure 30 Mirror tool.

 

Figure 31 Mirror dialog box.

 

Now we can attach all the items together. Select the axle and attach the wheels. When the dialog box appears asking for "Attach options" select the "Match Material ID's To Material" and click "OK".  Then give the object a meaningful name. If you selected a wheel and attached the rest to it then you will need to reset the pivot point. At this stage we also need to use the "Reset Xform" modifier. Select the axle/wheel unit and select "XForm" from the modifier list. You can also do the same by selecting "Reset XForm" from the utilities menu and then clicking the "Reset Selected" button. You will notice after applying the "Reset Xform" that the rotation coordinates are reset to zero. There are other modifiers such as smooth and mesh weights that can be added but this tutorial does not cover their use. Once you have added the "Reset XForm" right click on the axle/wheel and select "Convert to Editable Mesh" again.

 

Figure 32 End result

 

8. 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". If you have animations on the scene then select "Export" again and this time type anim.kin as the file name. When the "Export Animation" dialog box appears click on the "OK" button.

 

Was this tutorial helpful? Not enough or too much detail? Points not explained properly? Suggest any improvements? Please let me know what you think here.

Download this tutorial here as a PDF document.

 

 

HOME

| DOWNLOADS | UPCOMING PROJECTS | FEEDBACK | TUTORIALS | 3DS, GMAX TIPS | ABOUT | FORUM | SOFTWARE | LINKS

Copyright © 2004 P. Campbell. All rights reserved.

Revised: September 23, 2004
Site questions? webmaster