Home > Tutorials > TRS2006 Gmax Pantograph Animation Tutorial

Gmax Pantograph Animation Tutorial

In this tutorial you will learn how to animate a pantograph for a locomotive.

 

 

1. Add and resize shapes

You need to create six boxes and resize them as follows

 

Parameter
Box1 (BaseFrame01)
Box2 (FrameUpper01)
Box3 (ArmLeftLower01}
Box4 (ArmLeftUpper01)
Box5 (ArmRightLower01)
Box6 (ArmRightUpper01)
Length
1.0
1.0

5.0

5.0

5.0

5.0

Width
0.5
0.5
0.2
0.2
0.2
0.2
Height

0.2

0.2
0.2
0.2
0.2
0.2
Length Segs
1
1
1
1
1
1
Width Segs
1
1
1
1
1
1
Height Segs
1
1
1
1
1
1

 

Now that you have created and resized the objects I recommend that you rename them to the name shown in the brackets above. HINT. I always rename any object I create as this makes it much easier to find in the various lists of objects.

 

2. Rotating

Rotate the arms individually to the following angles

 
X
Y
Z
ArmLeftLower01
-5.0
0.0
0.0
ArmLeftUpper01
5.0
0.0
0.0
ArmRighttLower01
5.0
0.0
0.0
ArmRightUpper01
-5.0
0.0
0.0

.

 

3. Relocating

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

Co-ordinates
Box1 (BaseFrame01)
Box2 (FrameUpper01)
Box3 (ArmLeftLower01}
Box4 (ArmLeftUpper01)
Box5 (ArmRightLower01)
Box6 (ArmRightUpper01)
X
0.0
0.0
0.0
0.0
0.0
0.0
Y
0.0
0.0

-2.99

-2.973
2.99
2.973
Z
0.0

1.071

0.219
0.854
0.219
0.854

Now that we have everything in location we should have a result similar to figure 1

 

Figure 1 Results after resizing, rotating and moving

 

4. Dummy objects

The next item we need to add is a bone or dummy item. To add a dummy item in gmax you need to go to the "Create" tab and then to the "Helpers" tab

 

Figure 2 Dummy menu item

 

In this case you will need to create eight dummy items. It is recommended to create the dummies in the top view. Once you have created the dummy items you will need to rename them. For animation to work in Trainz the dummies must begin with b.r.   If you do not name them correctly then Trainz will not recognize them.

For this example I will name them as follows.

 

b.r.main
b.r.frameupper
b.r.leftpivot01
b.r.leftpivot02
b.r.leftpivot03
b.r.rightpivot01
b.r.rightpivot02
b.r.rightpivot03

 

5. Dummy placement

Once you have renamed the dummies you will then need to move the dummies to the correct location. The b.r.main should be moved as close as possible to 0x and 0y. The Z axis I usually keep the dummy about 200mm or 8" above 0. The location is not that important and in this case I have moved the dummy 500mm above 0.

The location of the other bones is however critical as it is what controls the animation.

 

Item
X
Y
Z
b.r.main
0.0
0.0
0.5
b.r.frameupper
0.0
0.0
1.171
b.r.leftpivot01
0.0
-0.5
0.1
b.r.leftpivot02
0.0
-5.464
0.636
b.r.leftpivot03
0.0
-0.5
1.171
b.r.rightpivot01
0.0
0.5
0.1
b.r.rightpivot02
0.0
5.464
0.636
b.r.rightpivot03
0.0
0.5
1.171

 

6. Linking

Once the dummies are in location we can then start linking the items together. To link them together first select the link button and then select the item

 

Figure 3 Link tool

 

To make it easier to see if a link has been made I usually change the view setting to "wireframe" which can be done by right clicking on the text in the top left corner of the workspace.

You need to create the following directory structure which can be shown by pressing H. At this stage we don't want to link the Piston01, Rod01 and b.r.piston objects to anything

 

Figure 4 Directory structure

 

You may need to check the box "Display Subtree" to show the structure. If you do not copy the above directory structure exactly then the animation will not work properly.

 

7. IK Solver

Before we can add the animation we need to add an "IK Solver" to each arm set. To do this we need to select the b.r.leftpivot03 and then go to the "Animation" menu then "IK Solvers" and then select "IK Limb Solver" from the list. A line will appear linked from the b.r.leftpivot03 to the cursor. Drag this link to the b.r.leftpivot01 and click on it. Do the same for the b.r.rightpivot03 except link it to the b.r.rightpivot01. You should now have a result similar to figure 6

 

Figure 5 IK Solvers

 

Figure 6 End result

 

7. Time rate

Once you have this directory structure we then need to set up the time rate for the animation. To do this we need to click on the following icon located in the bottom right hand corner.

 

Figure 7 Time setup button

 

Once you have the window shown in figure 8 open we need to change the Animation start and end time.

 

Figure 8 Time configuration menu

 

The easiest way to do this is to select the "Re-scale Time" button which will open the following window

 

Figure 9 Re-scale time window

 

Where it says frame count, change the value here to 30 frames. Some people use a different number here but I find 30 gives a good smooth animation. Once you have changed the frame count click OK and the animation start time should be the same at 0 but the end time should now be 29. If the "Track Bar" is not visible at the bottom of the screen then you will need to turn it on. To do this go to the "Customize" menu and the "Show UI" and select "Show Track Bar" from the menu.

Figure 10 Turning on the Track Bar

 

Where it says frame count, change the value here to 30 frames. Some people use a different number here but I find 30 gives a good smooth animation. Once you have changed the frame count click OK and the animation start time should be the same at 0 but the end time should now be 29. Also make sure the "Use TrackBar" checkbox is selected.

 

 8. Animation

Now we are ready to start the actual animation of the arms. Firstly select the b.r.frameupper dummy. Then select the move tool.

 

Figure 11 Move tool

 

Figure 12 Animation keys

 

In Gmax you will then need to select the animate button (See figure 10). Before you move anything you need to make sure that everything is in the correct starting location.

 

Figure 13 Zero key

 

This will set a base key or zero key as shown in Figure 13 which is the starting point of the animation. We now need to move the animation to key 29. Select the bar between the arrow keys and drag the bar to key 29. Make sure you have the move tool selected as shown in figure 8.

Once you have moved to frame 29 select the text in the Z: co-ordinate box and type in 7.171 and then press enter. If you have every thing linked correctly and the correct dummy selected then everything except the b.r.main and the BaseFrame01 should have moved up.

 

Figure 14 Move co-ordinates

 

9. Testing

When you have created a key for the two frames you can test out your animation by clicking on the "Play Animation" button. Everything should now work correctly. If it does not then check the link setup and also that you placed the IK Limb Solver from b.r.leftpivot03 to b.r.leftpivot01 and not the other way around.

 

10. Exporting

Once you have the animation complete then we need to export the fan 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". Then select "Export" again and this time type in a name and use the .kin extension. 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 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: June 13, 2007