From: "Boštjan Vesnicer" <bostjan.vesnicer@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: MetaPost Animation
Date: Fri, 16 Apr 2010 09:36:38 +0200 [thread overview]
Message-ID: <j2t1ea4ae671004160036jad97638fv3b58a200a175b5ef@mail.gmail.com> (raw)
In-Reply-To: <v2icf53c9501004151053j7152cc82rcc7f5066e486a03e@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2284 bytes --]
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 <thenders@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
>
> ___________________________________________________________________________________
>
[-- Attachment #1.2: Type: text/html, Size: 4191 bytes --]
[-- Attachment #2: Type: text/plain, Size: 486 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2010-04-16 7:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 17:53 Troy Henderson
2010-04-16 7:36 ` Boštjan Vesnicer [this message]
2010-04-16 7:54 ` Hans Hagen
2010-04-16 12:51 ` Troy Henderson
2010-04-16 14:19 ` Boštjan Vesnicer
2010-04-16 14:43 ` Wolfgang Schuster
[not found] <20050330203818.ADE29128CA@ronja.ntg.nl>
2005-03-31 1:48 ` Beginnner's question: fumbling with font finding failures Paul R Martin
2005-03-31 11:53 ` Thomas A.Schmitz
2005-03-31 12:50 ` Metapost animation Albrecht Kauffmann
-- strict thread matches above, loose matches on Subject: below --
2004-09-13 16:57 Michal Kvasnicka
2004-09-13 17:14 ` Henning Hraban Ramm
2004-09-13 19:40 ` Patrick Gundlach
2004-09-14 8:27 ` Michal Kvasnicka
2004-09-14 8:21 ` Patrick Gundlach
2004-09-14 16:33 ` Hans Hagen
2004-09-14 19:18 ` Michal Kvasnicka
2004-09-15 8:22 ` Hans Hagen
2004-09-16 17:05 ` Michal Kvasnicka
2005-05-19 14:28 ` Mojca Miklavec
2005-05-19 14:39 ` luigi.scarso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=j2t1ea4ae671004160036jad97638fv3b58a200a175b5ef@mail.gmail.com \
--to=bostjan.vesnicer@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).