[metapost] Animated graphics with Metapost?

Dirk Laurie dpl at sun.ac.za
Sat Jun 11 08:18:23 CEST 2011

I'd like to make an incremental version of a drawing, i.e.
when displayed it starts of with just a line and gradually
adds more lines, points, color fill-ins etc, which one can
then display as an animation.

I've thought of this approach:

1. Make a Metapost drawing of each stage, with the visible parts
    in black and the not-yet visible parts white.  This is the
    same drawing each time with only the colors varying so that
    there is no problem about superimposing frames of different size.
2. Import the Postscript files into GIMP and get it to make them
    into an animated GIF.


1. If you straight off know amuch better way, please tell me.
2. For stage 1, is there a way in which I can implement the
    following algorithm in Metapost?
    a. Draw everything in white
    b. for k=1 to n, draw k-th stage in black and export current
        version of the drawing as postscript.


More information about the metapost mailing list