Tutorial Home / Animate Objects / Keyframe Animation

return to Animate Objects


Overview

As previously stated, animation is created by changing the properties of objects (actors) over time. A keyframe is a slice in time (a frame) where a property has been set or changed. Between frames are calculated or interpolated by the computer. In traditional cel animation this process is known as tweening. Master animators draw the keyframes and apprentices do the in-between frames.

Keyframe animation is essentially the same in Synthetic Environments. The only important differences are that VRML animations are triggered by events or sensors and many separate animations can be triggered independently of each other. This adds a whole new dimension to animation as the action is not linear. Take, for instance, the following unfortunate situation:

Animation 1 is a car moving along a street only whilst it is visible to the user (visibility sensor).

Animation 2 is a pedestrian crossing the same street, triggered when the user approaches (proximity sensor).

If the Synthetic Environment developer doesn't put some thought into the outcomes given certain conditions then it is quite likely that the car could end up driving right through the pedestrian! A simplistic example, but important to understand as the user may not trigger events in the order you expect.

back to top | return to Animate Objects


Required Files

Download and unzip the following file (using WinZip) into the relevant folder of your working directory.

camera_sounds.zip (45.3Kb)

This file contains:

Note: memstick_textured.wrl and battery_textured.wrl are no longer included in the zip archive as it is assumed you already have them in the models folder of your working directory.

back to top | return to Animate Objects


Tutorial

Launch Cosmo Worlds and Open the file camera_sounds.wrl

Select the battery cover.

Open the Keyframe Animator

Select New from the Animation menu.

In the Animator Properties dialog box name the animation batteryAnim.

Change the Length to 60 frames (at the default 10 frames per second this equates to a 6 second duration).

Switch to the Trigger tab and select Touch Sensor

This creates a touchSensor attached to the battery cover that we selected at the beginning of the tutorial.

Note: if the Touch Sensor icon is ghosted out you'll have to re-select the battery cover in the viewport.

Close the Animator Properties window.

With the battery cover still selected add it as an actor to the newly created animation - Animation Menu > Add Actor.

Hide the battery cover.

Select the battery, add it as an actor then Show All

The Keyframe Animator should look like this:

Important: Notice how selected objects are highlighted in yellow, the same as the Outline Editor. Use this feature to ensure you are animating the correct object or group! When in Selection Priority Lowest it is very easy to select and animate a Child object rather than its Parent group. Refer to either the Outline Editor or the Keyframe Animator to make or confirm your selection.

Select Zoom to Fit on the right of the Keyframe Animator. This allows you to see the entire timeline from frame 1 to 60.  
With the battery cover selected move the Timeline Slider to frame 10.

Back in the viewport switch to the Perspective View

+ P

Rotate the battery cover to the open position.

In the Keyframe Animator record a keyframe by clicking on either of the red circles

Note: whenever a red record symbol lights up that indicates there has been a change to the object.

Select the newly created keyframe by clicking on the blue dot (it will turn red when selected).

Copy it + C

Move the Timeline Slider to frame 50 and Paste the keyframe + V

Repeat the above step to copy the keyframe at frame 0 to frame 60.

This makes the animation finish exactly where it started.

Select all the keyframes you've just created using the key and choose Linear from the drop-down list.

This changes the way in which the computer interpolates between keyframes. Linear is more appropriate for this animation but feel free to experiment with the other options.

Play your animation. The battery cover should open over 10 frames, remain stationary for 40, then close over the last 10 frames.  

Recap: This is the basic process of animation:

  1. Move the Timeline Slider
  2. Make a change to the object
  3. Record a keyframe
  4. Repeat until animation is complete
 
Try the above steps with the battery now.  

When you've finished the battery repeat the whole exercise with the memory stick ie.

  1. Create and name a new animation
  2. Set a timeframe and trigger
  3. Add the memory stick and its cover as actors
  4. Animate both objects
 
Save your work.  
Preview in Cosmo Player.  

back to top | return to Animate Objects