Hi Troy

Here is a simple solution:

\def\MyGraphics#1{%
\startMPcode
path p,q;
p:=fullcircle scaled 72;
L:=length p;
N:=20;
q:=subpath (0,#1/N*L) of p;
draw q withcolor red;
fill fullcircle scaled 3 shifted point length q of q withcolor blue;
setbounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75;
\stopMPcode}

\starttext
\dostepwiserecurse{0}{20}{1}{%
\startTEXpage
\MyGraphics{\recurselevel}
\stopTEXpage}
\stoptext

Regards, Bostjan

On Thu, Apr 15, 2010 at 7:53 PM, Troy Henderson <thend...@gmail.com> wrote:

> I am trying to create an animation in ConTeXt + MetaPost.  In
> particular, I would like to have ConTeXt + MetaPost generate each
> individual frame of the animation, and then I would like to place each
> of these graphics on the page in succession.  I am looking for a
> "ConTeXt way" without placing the MetaPost code in a separate source
> file, running MetaPost, and using \externalfigure.  The following
> MetaPost sample code generate 21 graphics images  (numbered .0 to
> .20), but I have no idea how to have ConTeXt generate these graphics
> without a manual external MetaPost run and have them included in a way
> that is consistent with \startuseMPgraphic or similar.
>
> Thanks in advance,
>
> Troy Henderson
>
> path p,q;
> p:=fullcircle scaled 72;
> L:=length p;
> N:=20;
> for n=0 upto N:
>        beginfig(n);
>                q:=subpath (0,n/N*L) of p;
>                draw q withcolor red;
>                fill fullcircle scaled 3 shifted point length q of q
> withcolor blue;
>                setbounds currentpicture to unitsquare shifted (-0.5,-0.5)
> scaled 75;
>        endfig;
> endfor;
> end
>
>
> --
> Troy Henderson
> Assistant Professor
> Department of Mathematics
> University of Mobile
> http://www.tlhiv.org
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to