Camera animations

Camera animation is much more common for prerendered 3D animation than for interactive virtual worlds but sometimes it is appropriate to take control of the user's viewpoint and animate it. Reasons for doing this include that you might want to follow or orbit the user's avatar (third-person view), move the user to a new location, or restrict the user's navigation options to predefined routes around a virtual world.

You can use techniques such as panning, orbiting and tracking a camera to make the camera move in interesting ways in relation to the centre of attention.

  • In a pan, the camera is at a fixed position but moves.
  • In an orbit, the camera moves but points at a fixed location.
  • In a track the camera moves along a fixed path pointed in a fixed direction.

To make a camera flight path more interesting, you can try tilting the camera as it turns (banking effect) and adjusting the rotation of the camera so that it follows the direction of a path (ie don't just animate the camera position). Really 'interesting' effects can be created by animating other properties of the camera, such as the field of view.

In VRML97, you can create a camera animation in the same way as the animation of an object. Either place a Viewpoint in a Transform that you animate (so that it moves with the Transform group), or update the Viewpoints position and orientation fields directly. If you are hand-coding an animation then it is often a good idea to use the Transform group approach as you can place a simple object in the group in order to view the 'camera' animation from another location in the virtual world before you actually place the viewpoint into the group.

VRML Example (Viewpoint in a rotating transform).
In this example, there are two viewpoints and two boxes. The green box is at a fixed location whereas the red box is in an animated transform that contains one of the viewpoints (enabling you to see what the camera is doing from the other viewpoint).

If the camera is to follow a fixed path then you will probably want to use an interpolator to animate the camera, but in cases where the camera path is not fixed, you will probably want to use a script to control the animation. The script operates in a similar way to an interpolator, but instead of calculating new values based on predefined key-values, the script calculates it's output values using a mathematical function. In both cases, a clock is used to control timing. We will look at how scripts can be used to control animation in the next module.




Michael Louka, October 10, 2001