Animation tutorial with Terragen
By Hoffmann Nicolas
1st part
Also available in French Fran├žais
2nd part available here
3rd part available here


The goal of this tutorial is not to find a nice method which will enable you to make a success of your animations every time (impossible you can believe me), but rather to give a general method which is, in my opinion, logical.
I will try to detail in stages the creation of a short animation.
It is far from being an exact science, you will certainly be sure of it by reading the example.

Plan of the tutorial

Top of the page

Necessary elements

Several elements are necessary to create the example.
Top of the page

1) To begin with :

You have to do some tests with Terragen, to find a good ground surface, to start to make a texture, in fact to have a general idea.
Personally, I move the camera a little everywhere on the ground, to see whether that gives me ideas, and to see whether the ground offers animation possibilities, I mean by this that it will be possible to give a route to the camera.
Here, I chose a 513*513 ground (there are possibilities of moving, without turning around too much). You can use a 1025*1025 one, but after that increase the rendering time later. I decided to add water, a simple texture (for the example, not wanting of having a headache making a complex texture), I rendered some previews, it is possible to make something interesting to my mind.
After increasing the sky size to 7500 to avoid a problem of black sky edge during animation, it is necessary to save the ground, and the world too.
Top of the page

2) 1st launching of Campath !

You can launch Campath, it is better to keep Terragen behind, that will be useful.
Here is a capture of Campath screen :
Campath !
  • The "File" menu allows you to open/save a ground/Campath file/Terragen script.
  • The "View" menu contains tools necessary to a better visualization of the ground (I will go back to it in the following stages)
  • The "Animation" menu allows you to animate (or not) clouds, sun, and other options (I will go back later too)
  • At last, "Miscellaneous" allows you to change various things (animation speed, the zoom, etc.), and contains various statistics (I will go back later again)..
  • "Use a Look at path" allows to specify a route which will be used as point of aiming with the camera (ie, where the camera looks at). I will talk about this in a second tutorial, because there is too much to say on this subject.
  • "Auto Banking" allows you to manage (badly) the camera banking (cf 5).
  • "Looping path" allows simply to "close" the animation : the arrival point will be that of departure.
opening of the ter file
Let's start : first thing to do : go into the menu "file", and import the landscape for animation ("open terrain file").
Top of the page

3) Water level and point placing 

The first thing to be done is to adjust the level of water. As Terragen remained opened, it is simple to verify which value was entered. With Campath, you just have to click on "Water Level", and to type the value, -3 for our example.
Immediately, water appears on our ground.
Then, it is necessary to lay out the points which will be used for the trajectory of the camera. By the way, you must check in "Control Points" that there is not already a starting point. (that often happens when opening the landscape, there is a point)
You can delete it by first clicking on "starting point", and then clicking on "Delete point"
This time, let's go !
basic trajectory
For information, when "Adds has a new path" is checked, you add a point, and when "Change point location" is checked, it is to move a point that you've selected in "Control Points" (the list of the points on the right).

I decide to make a small turn as indicated opposite.
The green point indicates the starting point.
(just some points, nothing more)
Top of the page

4) "Levelling" :

If you make a pre-visualization ("Preview Animation" button), we can see in the 3D-view that the camera passes below the ground. We can see this problem on the trajectory above, some parts of the trajectory are in red instead of being in blue, that indicates that the camera is below the ground (problem !). To solve this problem, a very useful tool in the "View" menu is available:"Height Graph". It doesn't look exceptional, but it is really very useful !
Height graph
As the image opposite shows, the trajectory passes under the ground.
You simply need to click on the point which you want to raise in the graph, the co-ordinates of this point will be in the Campath screen, and it will be necessary to increase "Absolute Height", or "Height above ground", which must be positive (except unknown special effect :) !).

However, it may be insufficient. 3D-view or ground view indicates that some passages are nevertheless below the ground.
The most obvious solution in this case is quite simply to add a point between the points where the problem is. For example, if you want to insert a point between point 4 and 5, click on "Insert Point", Campath asks "Insert a point after which point ?", and indicate 4.

CAUTION: you should check each time that the camera remains well above the ground, the insertion of a point can involve this kind of problem. In general, it is necessary to check each time the made modifications do not invalidate the job on the preceding points.

When there is no longer any part of the trajectory which is in red, and when the 3d view confirms this, we can pass to the next stage. (and you can be happy, because one of the trickiest parts has just been finished...)
Top of the page

5) Banking :

As I mentioned it above, "Auto-Banking" often gives bad results. Except in particular cases, it is better to manage yourself the banking. It is quite simple to do :
banking change
For our example, we see that I selected the point number 3 (in yellow on the image on the left). If we look at the trajectory, we see that a right slope would be necessary.
You just have to enter a positive banking (10) for a light slope.
If one wants the same slope towards the left, you'll just have to enter a banking of -10.
A value of 90 will put to us in right angle, 180 will put the head to us in bottom, and 360 will make us make a complete turn !
So you'll have to enter a value, see in the control panel if the banking is adapted or not, change the value, check, etc. With practice, you quickly manage to find good values...
Note : You can see that the course has changed, I decided to finish in a pseudo-crash, so the last point will have a increased banking, 365 for this exemple.
Note : this change in progress illustrates well the fact that this kind of work is never static. You can have an idea which suddenly makes you change everything in your animation , and so you'll have to start again (levelling of the points, etc.)

Top of the page

6) Zoom property :

Here's a funny, but rather dangerous property. Why ? Because it can contribute to give superb effects if it is well-used, but it can break the rhythm of an animation with sound, or it can make it difficult to add sound, because that changes the impression of speed. The principle is the same as for the banking, you change the value of the zoom for a point (by the parameter "zoom" of the point).
Once again, I insist on the fact that you should not use extreme values. You rarely go below 0.9 and go above 2 (except desired effect).
CAUTION : bugs remain if you use too low values for the zoom ! There is not a miracle solution, it is necessary to test, and to see whether it works or not.
If you want to see what that can give, take a look at my personal website in "anims" section, the first one uses this effect ("jeux de zooms" is its title).
Note : you can also modify speed for a point.
Top of the page

7) Cloud and sun movement :

More funny options : you can animate the clouds, and allow a rotation the sun.
Cloud animation
Sun animation
For the clouds, you have to go in "Animation", and to click on "Cloud Movement".
The image opposite shows what you obtain : you can regulate cloud direction (with ... "Cloud Direction" !) and the cloud speed (with ... "Cloud Speed" !).
Obviously it is necessary to check "Cloud Move" so it can take effect !
For the sun, you have to go in "Animation", and to click on ... "Sun Movement" !
The image opposite shows what you obtain : you can regulate the sun altitude at the starting point, and the sun heading.
You can do the same for the arrival point.
it may seem complicated or not very intuitive (especially the direction), but you can use the button "Preview".
personally, that helps me greatly to understand how the sun will move in my animation.
You will be able to notice that in the 3d view, we have a shaded ground according to the position of the sun. Very useful !
DANGER : a bug occurs sometimes in very long animations (several minutes), if the cloud movement is too fast, it may create problems in the sky...

Top of the page

8) Last modifications and informations :

There remain some interesting choices. In "Miscellaneous", "Global Change Menu" allows modification of various parameters, and this works on the whole animation (the zoom, the animation speed, etc.).
"Compute number of frames" gives you various indications on the animation. Other options are available, but I will not detail them here, try to see to what they do ! :p

However, there remains one important thing to do, save your Terragen script(.tgs).
In order to do it, go into "File", "save terragen script" and give it a name (tutorial.tgs for example). Then, Campath will ask where to save each image ("frame"), and the name of the generic file ("frame0001.bmp", "frame0002.bmp", etc.).
I advise you to create a directory for all these numerous files, it is more useful, especially if the animation is long.
Then, there is not any more but to launch Terragen, to load the ground, to load the world, to go into "Terragen", to do "execute script", and to indicate the script recently saved.
So, I advise you to be patient, for this example, this animation has taken approximately two days (48 hours !) to be rendered... at 400*300 !
Top of the page

9) Script division :

If you can't do the render all at one time, which is often the case, it is possible to split the render.
It is extremely simple. Your script file looks like this :
   ; This Terragen script created by the Camera Path Editor, v3.20

   ; Base filename for images followed by starting frame number.
   initanim "D:\images\terragen\anims\tut\www", 1

   ; Cloud movement activated. Format: 'CloudVel speed,direction'
   CloudVel 2.0, 55

   ; Sun movement activated. Format: 'SunDir heading,altitude'

   ; This script was created for a water level of: -3
   ; Individual frames follow. Total: 1210
   ; Frame #1
   CamPos 469.938543,47.40903,15.053843
   TarPos 468.876166,47.817763,14.568962
   CamB 0.0
   Zoom 1.411584
   SunDir 64.797516,30.012396
   ; Frame #2
Let us suppose that rendering has to be stopped at the image number 356 (the image number 355 has been calculated, and not the 356).
You'll have to modify your script to obtain this :
(This is the new file)
   ; This Terragen script created by the Camera Path Editor, v3.20

   ; Base filename for images followed by starting frame number.
   initanim "D:\images\terragen\anims\tut\www", 356 <-- indicate from where it is necessary to restart 

   ; Cloud movement activated. Format: 'CloudVel speed,direction'
   CloudVel 2.0, 55

   ; Sun movement activated. Format: 'SunDir heading,altitude'

   ; This script was created for a water level of: -3
   ; Individual frames follow. Total: 1210
   And here, it is necessary to remove all the useless lines, i.e. until the frame 356.
   ; Frame #356
   CamPos 310.668568,390.183069,12.54556
   TarPos 311.155884,391.356311,11.943218
   CamB -48.223358
   Zoom 1.82335
   SunDir 352.917358,34.413223
   ; Frame #357
Don't worry about the cloud movement if there is, there won't be a problem !
An editor like Wordpad or Notepad will do this. However, I highly advise you to save the end of script with another file name ("tutorial_end.tgs" for example), in there is a problem, you will be happy not to have destroyed the original script.
At last, it will be necessary "to assemble" all the images to create animation. You can add sound to make it becoming even better !

I just want to thank Kevin Bailey, for english correction !

Here is the result of this tutorial with a bit of music : zip file 10 Mb, Divx 5.01 codec minimum in order to see it !

To be able to read this tutoriel off line, here a zip file : zip file (about 700kb)

You can send me an email to tell me what you think about this tutorial, or to show me your animations !
Hoffmann Nicolas
Compatible document XHTML 1.1 and CSS

Valid XHTML 1.1!  Valid CSS!