3D
Studio Max Animation Tutorial
In
this tutorial you will learn how to animate the fan blades for a
locomotive. The methods used to create the fan animation can be adapted
to any Trainz object.
Note. To complete this tutorial you will
need to have available a model that has already been textured and has
an unwrap UVW modifier applied to it. You can get the demonstration
file here. 3DStudio Max will be referred to as 3ds.
|
|
1. Sample files
The
following screen shot shows the model I am working with. There are
two items in this model the fan guard and the fan blades.
|

Figure 1 Fan
|
|
2. Dummy objects
The
first item we need to add is a bone or dummy item. To add a dummy
item in both 3DStudio Max and 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 two 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 b.r.main and b.r.fans1
3. 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. The
location of the b.r.fans1 is however critical as it is what controls
the animation. For the fan blades the dummy needs to be at 0,0,0. If
it is not at this location then the fan will appear to oscillate when
the animation is running.
|
4. 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
|

Figure 4 Directory
structure
|
You may need to
check the box "Display Subtree" to show the structure.
|
|
5. 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 5 Time setup
button
|
Once you have the following
window open we need to change the Animation start and end time.
|

Figure
6 Time configuration window
|
The
easiest way to do this is to select the "Re-scale Time" button which
will open the window shown in figure 7
|

Figure 7 Re-scale
time window
|
| Where it says frame count,
change the value here to 31 frames. Some people use a different number
here but I find 31 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 30. Also
make sure the "Use TrackBar" checkbox is selected.
6.
Animation
Now
we are ready to start the actual animation of the fans. Firstly select
the b.r.fans1 dummy. Then select the rotate tool.
|

Figure 8 Rotate
tool

Figure
9 Animation keys
|
In 3ds you will
then need to select the set key button (See figure 9). Before you
move anything
you need to use the button with the key on it with the tool tip "Set
Keys" (Figure 9).
|

Figure
10 Zero key
|
This will set a base key or
zero key as shown in Figure 10 which is the starting point of the animation.
We now need to move the animation to the next key. Select the arrow
key pointing to the right as shown in figure 10 and the bar will move
and frame 1 will be selected. Make sure you have the rotate tool selected
as shown in figure 8.
Once
you have moved to frame 1 select the text in the z: co-ordinate box
and type in 12 then press enter. If you have every thing linked correctly
and the correct dummy selected then both the dummy and the fan should
have rotated 12º in a counter clockwise direction (looking from the
top).
|

Figure
11 Rotate co-ordinates |
|
Now
you need to press the "Key" button again then index to the next frame,
rotate the dummy and press the "Key" button. You will need to do
this for each of the 30 frames indexing the frame and rotating the
dummy 12º for each frame. This can be a slow process and there are
quicker ways to do this such as only setting three equally spaced
keys and using 3ds to calculate the values in between but this method
has worked the best for me and I will continue to use it.
|
|

Figure
12 Animation keys
|
|
7. Testing
When
you have created a key for each frame you can test out your animation
by clicking on the "Play Animation" button. If the fan oscillates
then you did not have the dummy located at the center of the fan.
If it
seems to skip or pause then you may have missed a step when setting
keys. Check each key manually and make sure that each frame number
has a rotation value as set out in the table below. If you have missed
a key then you will need to redo any of the keys that are incorrect.
You can also have problems when using 3ds to create the values in
between if you did not specify the correct value for the correct
key then 3ds
will calculate the rest of the values incorrectly and you will have
to start again.
|
Degrees
|
Frame
|
Shortcut
|
0
|
0
|
0
|
12
|
1
|
|
24
|
2
|
|
36
|
3
|
|
48
|
4
|
|
60
|
5
|
60
|
72
|
6
|
|
84
|
7
|
|
96
|
8
|
|
108
|
9
|
|
120
|
10
|
120
|
132
|
11
|
|
144
|
12
|
|
156
|
13
|
|
168
|
14
|
|
180
|
15
|
180
|
-168
|
16
|
|
-156
|
17
|
|
-144
|
18
|
|
-132
|
19
|
|
-120
|
20
|
-120
|
-108
|
21
|
|
-96
|
22
|
|
-84
|
23
|
|
-72
|
24
|
|
-60
|
25
|
-60
|
-48
|
26
|
|
-36
|
27
|
|
-24
|
28
|
|
-12
|
29
|
|
0 |
30 |
0 |
|
|
8. 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.
9. Config
entries
Now
that you have exported the file into the Trainz formats you will
need to set up a directory structure and create a config file
with the line "animdist X" for bogeys with the X being
the circumference of the wheel in metres. For scenery, locomotives,
interiors and rolling stock the animation needs to be set up in
the config file. Animations can be controlled with a script or
they can
be set to auto run. 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.
|