Home > Tutorials > TRS2006 Gmax Bogey / Truck Creation Tutorial

Gmax Bogey / Truck Creation Tutorial

 

In this tutorial you will learn how to create US style bogey / truck suitable for rolling stock.

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

You will also need the wheels created in this tutorial

 

To complete these tutorials with the dimensions listed herein you will need the following setup
1. Open the "Units Setup.." dialog from the "Customize" menu and select the "System Units Setup" button. In the "System Units Scale", use the system unit scale of 1.0 units = 1m
2. In the "Units Setup set "Display Units Scale" to Metric Meters.
3. Ensure the osnap settings are set to "Vertex" and that the "Snap Toggle" button is depressed. These settings can be accessed by right clicking on the "Snap Toggle" icon on the top toolbar.

1. Axles.

The first thing you need to do is open or merge the wheels created in the axle tutorial. At this stage only one is required. Once you have the wheels in the scene, save the file using an appropriate name and then select the wheel, then go to the "Display" tab and select "Hide Selected" from the "Hide" parameter. The wheels should now be hidden from view in the main windows.

 

 

Figure 1 Wheels from previous tutorial

 

Figure 2 Display tab icon.

 

Figure 3 Hide settings

 

2. Splines

Once you have hidden the wheel then we can begin the creation of the side frames of the trucks. The easiest way to do this is to use a spline and extract it to the desired thickness. Select the top view and then from the "Create" tab, select the "Shapes" sub-tab and then select "Line" from the parameters.

Figure 4 Create tab icon

 

Figure 5 Shapes tab icon

 

Figure 6 Parameters with Line selected.

 

Figure 7 Keyboard entry

Expand the "Keyboard Entry" parameters and type in the following points.

  X co-ordinates Y co-ordinates Z co-ordinates
Step 1 0.325 0.29 0.0
Step 2 -0.075 0.7 0.0
Step 3 0.125 0.7 0.0
Step 4 0.125 0.9 0.0
Step 5 -0.057 0.991 0.0
Step 6 -0.095 1.0 0.0
Step 7 -0.155 1.0 0.0
Step 8 -0.187 0.984 0.0
Step 9 -0.283 0.857 0.0
Step 10 -0.301 0.822 0.0
Step 11 -0.319 0.77 0.0
Step 12 -0.325 0.731 0.0

Once you have completed the above steps you should have something similar to figure 8. Now we need to create another line that will form part of the cutout for the spring. Ensure the "Start New Shape" check box is unchecked and the first spline is still selected and then click on the "Line" tool again and using keyboard entry enter the following dimensions.

  X co-ordinates Y co-ordinates Z co-ordinates
Step 1 0.206 0.177 0.0
Step 2 -0.174 0.177 0.0

At this stage both the new line and the first shape should be white i.e. selected. If both are not white then they will be considered as separate objects by max. If you have this problem then you will need to attach the two together or delete the line and repeat the above steps. Once you have the two splines created correctly then we can create another spline for the cutout between the springs and the wheels. Once again ensure the "Start New Shape" checkbox is deselected and the existing spline is selected. Select the "Line" tool and enter the following dimensions.

  X co-ordinates Y co-ordinates Z co-ordinates
Step 1 -0.114 0.307 0.0
Step 2 0.046 0.307 0.0
Step 3 0.057 0.311 0.0
Step 4 0.062 0.324 0.0
Step 5 0.063 0.34 0.0
Step 6 0.059 0.354 0.0
Step 7 -0.135 0.57 0.0
Step 8 -0.16 0.588 0.0
Step 9 -0.181 0.587 0.0
Step 10 -0.194 0.566 0.0
Step 11 -0.193 0.374 0.0
Step 12 -0.187 0.351 0.0
Step 13 -0.171 0.329 0.0
Step 14 -0.148 0.315 0.0
Step 15 -0.114 0.307 0.0

After entering the final step (Step 15) you should be asked to "Close the Spline" as shown in figure 10. If not then you have not entered the dimensions correctly.

 

Figure 8 Partial Spline after spline 1

 

Figure 9 Partial Spline after spline 2

 

Figure 10 Partial Spline after spline 3

 

Figure 11 Close spline dialog box

 

3. Mirroring

Before we mirror the partial outline we need to modify the pivot point. Ensure the spline is selected and select the "Hierarchy" tab. Then select the "Affect Pivot Only" button. Then type 0.0 into each of the co-ordinate boxes. This will relocate the pivot point for the mesh to 0 and allow a much easier mirror. Ensure the partial frame is selected and then select the "Mirror" tool. Use the settings shown in figure 14 and you should have a result similar to figure 15.

 

Figure 12 Hierarchy tab icon

 

Figure 13 Affect pivot only button

 

Figure 14 Coordinate boxes.

 

Figure 15 Mirror settings

 

Figure 16 Mirror end result

(NOTE: image has been rotated 90 degrees in a clockwise direction)

 

Now that we have both ends of the frame created we can use the line tool to complete the spline. Navigate to the Line tool and ensure that one of the frame ends are selected and that the "Start New Shape" checkbox is deselected. Then place the cursor over one of the spline ends on the first frame ensuring that the selection box shown in figure 17 appears at the end of the line and left click then drag the spline to the corresponding point on the other frame end. Once again ensure the selection box appears at the end of the spline and left click again. Repeat the procedure for the other three lines and you should end up with a result similar to figure 18. If all of your lines are different colors and are separate then don't worry we can fix this later on.

 

Figure 17 O-snap selection box

 

Figure 18 End result

(NOTE: image has been rotated 90 degrees in a clockwise direction)

 

4. Attaching and welding

Once you have the above result we can attach the other half of the frame. To do this select either end frame and then in the "Geometry" rollout select the "Attach" button as shown in figure19. Once selected place the cursor over the other end of the frame and the icon shown in figure 20 should appear. Left click and the spline should change color to show that it is now apart of the rest of the spline. If you have multicolored lines (or separate splines) then repeat the procedure until all splines are attached to form one spline. Also ensure that the pivot point (Red Arrows) is still at 0,0,0. If not then you have attached the shaped spline to the straight splines rather than the other way around. Use the "Hierarchy" tab to set the pivot point to 0,0,0.

Figure 19 Attach button in Geometry parameters rollout

 

Figure 20 Spline attach selection cursor.

 

Now that we have a single spline object we need to go over each end of the splines and weld them together. Some people use the "Auto Weld" feature when creating the splines however I have found that nine times out of ten it does not work and you end up having to go over each point in the end any way.

To weld the vertices together firstly select the spline and then select "Vertex" from the window below the modifiers list or select the "Vertex" icon in the "Selection" rollout. The first thing you will notice is that all the points on the spline now have either a cross or a box over them. The boxes are the first to target for welding. Zoom in on one of the boxes and place a selection box over the box to ensure that both vertices are selected. (Left click and drag over the vertices). Once selected, looking over to the right at the bottom of the "Selection" rollout it should now say "2 Vertices selected" as shown in figure 24.

 

Figure 21 Spline vertex selection

 

Figure 22 Spline showing different shaped vertices

(NOTE: image has been rotated 90 degrees in a clockwise direction)

 

Figure 23 Spline vertex selection box

 

Figure 24 Selection rollout showing 2 vertices selected.

 

Now we can weld the two vertices together. To do this you need to scroll down past the "Selection" rollout until you arrive at the "Geometry" rollout. About halfway down this rollout you will see the "Weld" button. Click on it once and the vertices will be welded together. Repeat the procedure for the rest of the vertices with a small white box over them.

 

Figure 24 Weld button

 

5. Extruding

Now that we have a continuous spline we can extrude the mesh to the desired thickness. Ensure the frame is selected and then from the modifiers dropdown box select "Extrude". In the "Amount" box type in 0.1. If you end up with a result similar to figure 26 then the outside perimeter of the spline has an unwelded vertex or vertices. If you end up with a result similar to figure 27 then the cutouts perimeter has not been fully welded or you have failed to attach all the splines together. Once complete right click on the mesh and select "Convert to:" then "Convert to Editable Mesh"

 

Figure 25 Extrude modifier

 

Figure 26 Outside perimeter of spline incorrectly welded

 

Figure 27 Perimeter of cutouts incorrectly welded

 

Figure 28 Correctly welded and extruded mesh

 

6. Rotating, moving and mirroring.

Now that we have the shape of the outer frame we need to rotate and move the spline into the correct location. Firstly select the "Select and Rotate" tool and rotate the mesh 90 degrees in the "Y" axis. (Middle box at the bottom of the screen). This will turn the mesh the correct way up. Now we can move the mesh into location. Select the "Select and Move" tool and move the mesh to the following location.

X Y Z
0.9 0.0 0.025

 

Once again use the "Hierarchy" tab and "Affect Pivot Only" to move the pivot point to 0,0,0. Then using the mirror tool mirror the side frame across to the opposite side. Use the settings shown in figure 29.

 

Figure 29 Mirror settings for side frame duplication

 

7. Wheels and axles.

Now that the side frames are positioned correctly we can unhide the wheel/axle combination and move it into position. Go to the "Display" tab and from the "Hide" rollout select the "Unhide by Name" button and then in the "Unhide Objects" window select the wheel/axle. In this situation where there is only one object hidden we could also have used "Unhide All".

 

Figure 30 Hide options

 

Figure 31 Object list

 

Once unhidden select the wheel and move it to the following location.

X Y Z
0.705 0.792 0.0

Using the mirror tool mirror the wheel to create the second wheel/axle combination. This time as we do not want to upset the pivot point of the axle we need to specify a dimension for the mirror tool to work correctly. Use the settings shown in figure 32.which shows an offset of -1.584m. Once complete and you have two sets of wheels and axles I suggest you name all the parts to allow easier selection and identification when we start the animation.

 

Figure 32 Third mirror settings

 

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 "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".. 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 with no textures

 

Figure 10 Material Editor showing Material #1

 

Figure 11 Material Editor showing the globe

 

Figure 12 gmax Material Navigator with all textures loaded

 

Figure 13 Blue and white cube

 

When you have completed the texture loading select the globe at the top of the material editor as shown in figure 11 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". If you have more than one texture in the scene you can use the "gmax Material Navigator" to switch between them.

 

 

Figure 36 Applying the Unwrap UVW modifier

 

For the simplicity of this tutorial I will only show a mass texturing method for the entire side frame rather than a detailed process for each section. Select "Edit" from the "Parameters" rollout for the "Unwrap UVW" modifier and then move the mapping to a location similar to figure 37.

 

Figure 37 Material mapping in correct location

 

Repeat the procedure for the opposite side. This could also have been done before mirroring the side frames.

 

9. Creating the springs

Now that the side frames and wheels are created and textured we can create the springs. In this situation where only the outer face of the springs are visible we can cheat a little and just use some cylinders touching together and all hidden faces removed. This allows us to use 28 polygons where to actually model the spring would require any thousands of polys. Create three cylinders with the following dimensions.

Parameter Cylinder 1
Radius 1 0.05
Height 0.206
Height Segments 1
Cap Segments 1
Sides 6

Now convert the cylinders to editable mesh and remove the unseen faces from each cylinder as followsCylinder 1 Remove the top and bottom polygons and the right side center polygon.Cylinder 2. Remove the top and bottom polygons and the right and left side center polygons.Cylinder 3.Remove the top and bottom polygons and the left side center polygon.

You should end up with a result similar to figure 38. In order to delete the polygons you need to use the "Polygon" selection tool from the objects "Selection" rollout and simply select the polygon and press the delete key. Use "Arc Rotate" to rotate the viewport to remove the base polygons. Once you have removed the polygons then the cylinders can be moved into location. Select each cylinder and move it into location as shown in figure 39. Once in position use the "Attach" tool from the "Edit Geometry" rollout to attach the three cylinders into one object.

 

Figure 38 Cylinders with polygons deleted (viewed in wireframe)

 

Figure 39 Finished mesh

 

Now we can add the textures to the cylinder. Repeat the steps above to apply the texture and the "Unwrap UVW" modifier. Once complete change the settings of the "Unwrap UVW" modifier to "Select Face" and then use the "Parameters" rollout of the "Unwrap UVW" modifier and setup as shown in figure 40 use "Planar Map" to create a snapshot of each cylinder then click the "Edit" button and arrange the texture as shown in figure 42. Repeat the procedure for the other two cylinder segments.

 

Figure 40 Unwrap UVW parameter settings

 

Figure 41 Sides of first cylinder selected for texture alignment

 

Figure 42 Textures aligned correctly in "Edit UVW's" window

 

Now using the "Select and Move" tool, select and move the cylinder into location in the recessed area in one of the side frames then using the mirror tool mirror the spring across to the other side.

 

Figure 43 Spring in correct location

 

10. Crossmember

Now that we have the springs and wheels in place we need to create the crossmember. Create a box with the following dimensions

Parameter Box 1
Length 0.34
Width 2.0
Height 0.16
Length Segments 1
Width Segments 1
Height Segments 1

Once created move the box to the following location.

X Y Z
0.0 0.0 0.025

Once finished add a texture to the box and then map the texture to a part of the bogey texture.

 

11. Animation

Once we have everything in location we can then begin the animation for the wheels. The first thing we need are two dummies. Change to the TOP view port and from the "Create" tab select the "Helpers" sub tab and then click on the "Dummy" button. In the TOP view port left click hold and drag the mouse to create a small dummy. Repeat the process for the second dummy. (If gmax will not let you create a box shaped dummy as shown in figure 46 then turn off the osnap settings)

 

Figure 44 Helpers tab icon

 

Figure 45 Dummy button selected ready for creation

 

Figure 46 Small dummies created ready for relocation.

 

Now that the dummies are created we need to rename them and move them into location. Select one of the dummies and rename it to b.r.main. Move it to the following location using the "Select and Move" tool.

X Y Z
0.0 0.0 0.5

Now select the second dummy and rename it to b.r.wheel0 and move it to the following location

X Y Z
0.0 0.792 0.0

Once we have the dummies location and named correctly then we can begin the animation. The first thing we need to check is that the time is set correctly. Click on the "Time Configuration" button (bottom right of screen) and ensure the settings shown in figure 48 are correct.

 

Figure 47 Time configuration icon

 

Figure 48 Time configuration settings

 

Once you have these settings set correctly then we can begin the actual animation of the dummies. Select the b.r.wheel0 then select the "Motion" tab and expand the "Assign Controller" rollout. In the window you will see "Rotation : Euler XYZ" this is the correct controller for what we want to achieve. If you are presented with "TCB Rotation" then you will need to change by clicking on the "Assign Controller" icon and selecting "Euler XYZ".

 

Figure 49 Motion tab icon

 

Figure 50 Assign controller roll out

 

Figure 51 Assign controller icon

 

Once you have the correct controller in place then we need to expand the controller and add a new sub-controller to it. Click on the small + sign next the "Rotation : Euler XYZ" and select "X Rotation : Bezier" then click on the "Assign Controller" icon to bring up the "Assign Float Controller". Select "Float Expression" from the list and click "OK". The "Expression Controller : b.r.wheel0\X Rotation" window will now appear. In the "Expression" section you should see a 0. Delete the 0 and replace it with 360*sin(NT) Then click on the "Evaluate" button and then the "Close" button.

 

Figure 52 X Rotation : Bezier selected

 

Figure 53 Assigning a new float controller

 

Figure 54 Expression controller settings

 

Figure 55 Float Expression controller correctly added

 

Once you have the animation added then we can duplicate the dummy for the second wheel set. Hold down the "Shift" key and using the "Select and Move" tool select the b.r.wheel0 and move the wheel. When you release the mouse button max will ask you how many copies you want. We only need 1 copy so leave everything at the default value. You can rename the dummy in the clone window if you wish or you can rename it later. Rename the new dummy to b.r.wheel1. Move the new dummy to the following position.

X Y Z
0.0 -0.792 0.0

.Test the animation by clicking on the "Play Animation" button at the bottom right of the screen. The two wheel dummies should rotate smoothly. Once you have checked the animation then click on the "Go To Start" button to return the animation to the first frame.

 

12. Linking

Now that we have the dummies animated we need to link the wheels to the dummies and everything else to the main dummy. To do this we need to use the "Select and Link" tool from the main toolbar. There are two methods you can use to link each item, you can select the item then drag the link to the parent or you can select the item and then press "H" and select the parent from the list.

 

Figure 56 Select and link tool

 

Figure 57 Correct link structure

 

Link b.r.wheel0 and b.r.wheel1 to b.r.main

Link wheel0 to b.r.wheel0

Link wheel1 to b.r.wheel1

Link Crossmember, Sideframe1, SideFrame2, Spring1 and Spring2 to b.r.main

Ensure the "Display Subtree" checkbox is selected.

Once you have the link structure correct then you can test the animation again. The wheels should now rotate smoothly in addition to the dummies. If one of the wheel oscillates then either the dummy is located incorrectly or the wheel itself is in the wrong location. Check the locations and try again.

 

13. Bogey exporting and config.txt

Before we export we need to create a new asset with CMP which is done by clicking on the "New" button or by selecting "File" "New" from the main menu. Once you have the "New Asset" window open scroll down to the "Bogey" entry select it and then click on the "New" button. You will then be presented with the Content Creator Plus program with a Bogey asset and the default config entries. The first thing we need to do is to give the asset a name. Type Coupler Bogey into the username tag in the Tag Space.

Once you have named the mesh we need to add a mesh-table container to the directory. To do this right click in the "Tree View" area and select "mesh-table" from the available containers at the top of the list.In the "Enter Name" window type in "default" and click OK. You should now be able to see the mesh-table entry in the tree view area. Now that we have an asset partially created in CCP and the config started we need to switch back to CMP and select the asset and then from the right context menu select "Edit" and then "Edit in Explorer" This will open a windows explorer window at the new assets path. Once the explorer window is open note the path of the directory as this will be the location for the main mesh. Switch back to gmax and make sure you have nothing selected and from the "File" menu select "Export". Navigate to the folder for the asset and type in the filename Tutorial_bogey.im. Before you hit the "Save" button change the file type in the drop down window to "Trainz Format(*im, *kin, *pm). Once you have this selected click on the "Save" button. gmax will begin to convert and export the mesh into the Trainz .im format. While still in gmaz export the mesh again only this time change the filename to anim.kin This is for the animation of the wheels and axles. This file must be exported to the same directory as the config.txt file. It will not work if you place it anywhere else

 

Figure 2 New toolbar button

 

Figure 3 Creating a new Bogey asset

 

Figure 4 Default entries for a Bogey asset (NOTE: Default installs of TRS2006 will have far more eras and regions.)

 

Figure 5 Adding a Mesh Table

 

Figure 6 Naming the mesh-table's first container

 

 

Figure 7 Default entry added

 

Figure 8 Export

 

14. Adding containers

Switch back to CCP from gmax and in the tree view ensure the "default" entry of the "mesh-table" is selected. In the "Tag Space" click on the file selection button and use the "Load Mesh" file explorer to navigate to the folder containing the mesh. Select the mesh and click on OK. The path to the mesh should now be showing up in the mesh tag. While we have the default container selected right click in the tree view and add the following tag.

auto-create

ensure the check box is selected which activates that entry. If you have added a shadow mesh then you can also add another mesh to the mesh-table container. In this case name the container "shadow". Once added use the file navigation button and explorer to select the shadow mesh. No other tags are needed for the shadow mesh so we can move on to the next container.

In the file tree view right click and add the following tags.

company
light
description

Also add the following container.

thumbnails

Once the tags and containers have been added then enter the following values for each tag

Tag name Description and recomended value
direct-drive

This tag refers to wether to treat it as a steam locomotive bogey or not. 0 is the correct entry for a non steam locomotive bogey.
0

kuid This is an uneditable entry and cannot be changed.
trainz-build This is an uneditable entry and cannot be changed except in a text editor.
category-class

Select the required class from the drop down box. In this case we need to select
ZB - Bogie/Truck

category-region

Select the required regions by clicking in the checkbox next to each item. You can add as many regions as you like. In this case select the following;
CA; US

category-era

Select the required era's by clicking in the checkbox next to each item. You can add as many era as you need. In this case select the following;
1970s; 1980s; 1990s; 2000s

username

Type in a sutiable name for the asset. In this case I have used the following;
Tutorial Bogey

kind This tells Trainz that the kind is a bogey and not a scenery or track item and is an un-editable entry and cannot be changed
company

This is a company name for the item. In this case I have used the following value;
Tutorial

light Sets lighting to be used for object to be ambient or directional. If the checkbox is selected then the lighting is set to directional light which is affected by the position of the sun.
description
This is a description about the truck. It can be brief or very detailed. I have used the following text for this tag
Standard US bogey/truck

 

 

 

Was this tutorial helpful? Not enough or too much detail? Points not explained properly? Suggest any improvements? Please use the Tutorial Enquiry Form

 

 

Trainz and Trainz Railroad Simulator are trademarks of Auran

Best 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: February 22, 2008