The Complete Guide to Blender Graphics

A Train on a Track

A Train on a Track.

In this exercise we will create an animation of a train moving around a circular track.


To produce the animation we require a model of a train and carriages and the track on which it runs. The track will comprise rails and sleepers. This exorcise will demonstrate the technique rather than the detail therefore the modelling will be as basic as possible.


The train and the track will be generated using a curve path which defines the shape of the track and the position of the train on the track.


Begin by placing the 3D window in “Top Orthographic” view, scale the default “Cube” object down (S Key, Type 0.3, Press “Enter”).



The Curve Path


In a new Blender scene add a “Curve Path”, “Bezier Circle” in “Top Orthographic” view. Don't forget to deselect the default “Cube” object. You may leave the cube in the scene since it will be used for creating the train.


With the “Bezier Circle” in place scale (S Key, Type 8, Press “Enter”) and shape it to represent the shape for your track. The shape may be as complex as you like but remember that trains do not run around tight curves. Keep in mind the scale of objects in the scene and how they will relate to each other. If you intend to produce something with considerable detail select a scale and stick to it. For example, one Blender grid unit equals one metre.


The Track


A railway track consists of two steel rails secured to a series of wooden or concrete sleepers. To create the track model a track section consisting a single sleeper with two short sections of rail as shown in the diagram. Rail gauges (The distance between the inner edges of the rail) vary considerably depending on the type of transport device and depending on the country in which they operate. A standard gauge in the UK, USA, Canada and Australia is measured at 1.435 Meters (4 Ft. 8.5 inches). In modelling our track we can approximate a scale for simplicity. Join the sleeper and track sections into a single object.


Note: Add different material to the rails and the sleeper before joining.



With the track section selected add an “Array” modifier. By default the “Fit Type” is “Fixed 75 Count”, “Count is 2.000”, “relative Offset” is checked with the X value 1.000. This duplicates the track section on the X axis. Increase the “Count” value to create more duplications.



Add a second modifier, this time a “Curve” modifier. Set the “Object” to “BezierCircle”.


The duplications of the track section will be arranged on the curve. Increase the “Count” value in the “Array” modifier until the track sections are duplicated around the entire curve. You may be lucky and have the last section meet up with the first but if not leave a gap and select the opposite faces of the ends of the rails and apply faces to join the ends together.


Remember the distance between the rail ends doesn’t have to be exact unless you plan on a close up of this particular join.



The Train


For the train model, start with the default “Cube” object and scale it to resemble a single train carriage or car. Make the proportions appropriate for the scale of the track. Since we are only demonstrating a technique we will ignore any detail such as wheels or windows.


Leave the carriage located at the centre of the scene and have it selected. Add a “Follow Path” constraint. Check (Tick) “Follow Curve” and set the “Target” to “BezierCircle”. The carriage will relocate to the track but you will have to set the “Forward” value to X to align the elongated cube with the track.


For the time being we will leave the train consisting only a single carriage.


Animation


The single carriage is animated to follow the curve as described in the supplement on that subject. In the “Bezier Circle”, “Path Animation” tab leave the default “Frames: 100”, set the “Evaluation Time” value at 0.000 for Frame 1 in the animation and 100.000 for Frame 250.


Play the animation in the “Timeline” window to see the single carriage traverse the track in 250 frames.


Adding Carriages


Stop the animation at Frame 1 and select the single carriage. Press “Shift + D + Enter” to duplicate the carriage. This duplication has an identical “Follow Path” constraint applied. With the new carriage selected adjust the “Offset” value in the constraint panel to reposition the new carriage along the track. Repeat the procedure to duplicate as many carriages as you wish.


Playing the animation in the timeline will show the whole train moving around the track. You may select each carriage individually and remodel in “Edit” mode.


Tip: If carriages are to have identical features such as wheel sets, windows, doors etc. model them before duplicating carriages.



Home Book Content Supplements The Author