IRIS Explorer Technical Tips

by Jeremy Walton, NAG Limited


I'd like to be able to make an animation of a scene displayed in Render. How can I do it?

The answer to this question has two parts - how to create the animation, and how to save it.

The display model in Render is a camera pointing at a scene consisting of a collection of geometric objects (lines, surfaces, spheres, etc). The animation could be produced in a number of ways, such as moving the camera around a static scene, keeping the camera fixed while the scene changes, moving one of the objects within the scene, etc. Some of these examples are illustrated in the demo maps. For example, the flythru map features a flight around a scene containing a coloured surface, while the vslice map illustrates a changing scene which contains a slice that moves through a vector field. Finally, the animateIso map features a camera moving around a scene that is changing as new isosurfaces are created.

Making the camera move can be done using the AnimateCamera module. Essentially, this takes a set of key camera positions and directions (which can be given to the module when it is in 'Learn' mode, or read in from a file, as in the case of the demo maps) and interpolates between them to produce a smoothly varying viewpoint. The module allows for user control over the step size and delay when creating the animation, as well as other parameters.

Other modules can be used to create a changing scene. IRIS Explorer's support for loops in maps allows parameters to step through a sequence of values - for example, the For module generates iterations of a variable which can be connected to other modules in the map. Thus, in the vslice map, it is the slice number that is being varied, while in the animateIso map it is the isosurface threshold value.

Having created the animation, how can it be saved? The Render module can be put into a mode where each change to its display (whether caused by a change in the camera, or a change in the scene) causes the image to be snapped and written to its Snapshot output port. If this port is connected to the WriteAnimation or WriteMovie module, the image will be added to either an animation (in the FIT format) or a movie (in the SGI moviefile format). By default, however, Render does not automatically snap its image each time it changes. Render's behaviour here is controlled by a parameter port named Snap On Redraw. To turn it on, connect it to a port which outputs a non-zero parameter. For example, use the WidgetsIntegerSlider module, which was designed for use in precisely this situation (see its manual page), and set the slider to some non-zero value. So, make the following connections:

Render::Snapshot -> WriteAnimation::Input (or WriteMovie::Input)

WidgetsIntegerSlider::Integer Slider -> Render::Snap On Redraw

Type a filename into the text slot on WriteAnimation; the currently rendered image will be written to that file, and each time that image changes, the new image will be added to the animation. Note that the resolution of the animation is determined by the size of the Render window when the first image was snapped.


Last modified: Wed Jul 24 16:48:24 1996
[ Previous Article : Render Home : Next Article ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996