Creating a Simple Animation-Part One

From Planetside Software Wiki
Jump to: navigation, search

This tutorial shows you how to create a basic animation. We're going to move a sphere along the ground, move it up in the air and then drop it back to the ground. We'll do this two ways. The first way will be done entirely using the main window timeline and param views. The second way will be done using the Animation Panel. This should help you understand the basic processes of animation in Terragen 4 and also show you how the Animation Panel makes animating easier.

Animating with the main window

  1. Start Terragen.
  2. Create a Sphere object to animate. You can do this by clicking on the Objects layout button and then using Add Object button at the top right. Click the button and choose Object > Sphere from the menu that pops up.

  3. Set the Radius of the new sphere to 25.

  4. Set the Centre of the sphere to 0, 25, 0. This will move it to the scene origin and have it just sitting on the ground. You might like to change the 3D Preview so you can see the sphere better.

  5. This is starting position for our animation. We are going to be moving the sphere along, raising it up in the air and then dropping it back down. To do this we will be animating the Centre param. Click the animation button for the Centre param. Choose Set animation key > Key all from the menu which pops up.

    The Centre param is a vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank., which means it has multiple components - X, Y and Z. When you set a key on a param with multiple components you can choose to either set a key for all components or set a key on individual components. For example in this tutorial we will only be moving the sphere along the X axis and the Y axis so technically we could just set keys for those components. For simplicities sake we are going to set keys on all components though.

  6. Note that the colour of the Centre param text fields has changed. Animated params show their text in green when they're on key frame and blue when they're not on a key frame. Change the frame number in the timeline at the bottom of the window to 2. You will see the colour of the text change to blue, showing that the param is animated but not on a key frame.

  7. Now we're going to move the sphere along the ground a bit. Change the frame number in the timeline to 20. Now change the X component of the Centre param to 200. You will see the sphere move in the 3D Preview.

  8. Set a key on the Centre param. Click the animation button for the Centre param. Choose Set animation key > Key all from the menu which pops up. You will see the text of the param change to green showing we now have a key frame at frame 20.

  9. We now have a basic animation. Use the slider in the timeline to scrub through the animation. Move it to the left and you'll see the sphere move left in the 3D Preview. Move it back to the right and you'll see the sphere move, until the slider gets past frame 20.

  10. Notice that you don't have to set a key on every frame to get motion. Terragen calculates the values for every frame inbetween the ones where you set keys. This is called interpolation.

  11. Now we're going to make the sphere rise up in the air. Set the frame number to 30. Set the Centre param to 300, 200, 0. Use the animation button to set another key just as we did before.

  12. Use the slider in the timeline to scrub between frame 0 and frame 30. Notice how the sphere rises up in the air. You might notice it follows a curved path. By default Terragen calculates the positions between keys using a smooth interpolation method which gives a curved kind of motion. You can see the inbetween values that Terragen has calculated in the Centre param when you scrub with the timeline slider.

  13. Next we'll drop the sphere back down to the ground. Set the frame number to 40. Set the X component of the Centre param to 400 and the Y component to 25. Use the animation button to set a key on all components.

  14. Now we'll move the sphere to the end point for the animation. Set the frame number to 60. Set the Centre param to 600, 25, 0. Use the animation button to set a key on all components.

  15. Use the playback controls in the timeline to watch your animation. Try scrubbing back and forth using the slider.

  16. Here's a movie rendered from what we have so far:

    The media player is loading...

    Something which is immediately obvious is that the sphere drops below the ground! This is an effect of the interpolation method used to calculate all the param values inbetween keys. The interpolation makes a nice smooth motion but not quite what we want. To try and fix this we can go back to the frames where we set keys as the sphere started to rise and when it dropped back to the ground. The sphere looks like it has gone halfway into the ground so we will raise it up by the sphere radius at both those frames. Let's do that now.

  17. Set the frame value to 20. Now increase the Y component of the Centre param to 50, which is the original value plus the radius of the sphere. Please note that although we've changed the value of a keyed param the change doesn't get applied automatically to the key. If you were to scrub away from the 20 and then back to it you would see the Y value was back to 25. You need to set a new key on the param to get the change to stick. This new key replaces the old one. Make sure the Y component is still set to 50 and set a new key on the param.

  18. Now go to frame 40 and repeat the previous step there.

Here's another movie rendered with the changed animation:

The media player is loading...

As you can see the sphere no longer dips as badly, although it still does a little. Of course the movement of the sphere isn't quite what we had before either. It starts rising sooner and drops all the way to the ground later.

What we've done is create a basic animation. It was pretty easy to do only using a few tools. However it doesn't really give us a lot of control. It would be great if we could see the motion of the sphere more clearly. It's also a bit tricky to figure out where we set key frames. If you don't remember what frames you set keys on the only way to tell where they are is to scrub with the timeline slider and watch for the colour of the param text to turn green.

Happily there is a way we can edit animation more easily and that's using the Animation panel. In the next part of this tutorial we will use the animation panel to create the same animation.

Before we go on let's go back over some of the key points of this tutorial:

  • You can set keys on a param using its animation button.
  • If a param has multiple components, such as vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. or colour param, you can choose to set keys on all the components at once or on the individual components.

  • You can set the current frame of the animation using the timeline in the window.

  • Params with keys colour their text green when the current frame is one which has a key set for it. When the text is blue it means there isn't a key set at that frame.

  • Terragen calculates values for frames inbetween ones where you've set keys. You don't need to set a key on every frame. Calculating the inbetween values is called interpolation.

  • You can use the slider in the main window timeline to move or scrub through the animation. You can also use the timeline playback controls.


You can download a project file for this tutorial here.


Carry on to the next part of the tutorial