From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58165 Path: news.gmane.org!not-for-mail From: =?ISO-8859-2?Q?Bo=B9tjan_Vesnicer?= Newsgroups: gmane.comp.tex.context Subject: Re: MetaPost Animation Date: Fri, 16 Apr 2010 09:36:38 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0705699565==" X-Trace: dough.gmane.org 1271403427 9796 80.91.229.12 (16 Apr 2010 07:37:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Apr 2010 07:37:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 16 09:37:05 2010 connect(): No such file or directory Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O2g6q-0004j0-Is for gctc-ntg-context-518@m.gmane.org; Fri, 16 Apr 2010 09:37:04 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D10B8C9C40; Fri, 16 Apr 2010 09:37:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gq1EjCC9N-uL; Fri, 16 Apr 2010 09:36:52 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 36381C9C73; Fri, 16 Apr 2010 09:36:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 02D13C9C73 for ; Fri, 16 Apr 2010 09:36:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KOcaCfqKXvox for ; Fri, 16 Apr 2010 09:36:39 +0200 (CEST) Original-Received: from mail-bw0-f228.google.com (mail-bw0-f228.google.com [209.85.218.228]) by balder.ntg.nl (Postfix) with ESMTP id D4EDBC9C40 for ; Fri, 16 Apr 2010 09:36:39 +0200 (CEST) Original-Received: by bwz28 with SMTP id 28so2351383bwz.14 for ; Fri, 16 Apr 2010 00:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=IUagMeB3a+gE7ItXrq4lpuLRlKxCI2GlEqgLY95GzS0=; b=i2CVWaT2QVyqwLDrsF8N1gYVbHJvp/K9ChbBo1eb07uj4PucxNfcsVnvMpDwpXDr78 VUE02Z+Ge6nmAWglZNw/iG3OtU9MXFRFLPfPWypn4D0J01MiU1QCx9GNjTqx8dPOk+se Ro7jkxgLVnTfHwfL8SdFmNUgkHWhGTdsRNrhw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Za+/XsYnW+TPqgirGUwSycLpEJisHeasgj1XDZ+p4gcailzMgEATZYeVj9OMjMWrzR W5mep76rHDbgKs85AYXl5Wj5aiKcYZKP6e3Xz1r6V6uwLW0I2J7mQUYBgpGZ0OLvRHDA QtVyKCZ6w/qC/RMnsabMRiU+h0vPibWcbyvRE= Original-Received: by 10.239.150.67 with HTTP; Fri, 16 Apr 2010 00:36:38 -0700 (PDT) In-Reply-To: Original-Received: by 10.103.67.38 with SMTP id u38mr784138muk.107.1271403398532; Fri, 16 Apr 2010 00:36:38 -0700 (PDT) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:58165 Archived-At: --===============0705699565== Content-Type: multipart/alternative; boundary=0016e659fc0cef8f74048455ab48 --0016e659fc0cef8f74048455ab48 Content-Type: text/plain; charset=ISO-8859-1 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 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 > > ___________________________________________________________________________________ > --0016e659fc0cef8f74048455ab48 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Troy

Here is a simple solution:

<= div>
\def\MyGraphics#1{%
\startMPcode
path p,q;
p:= =3Dfullcircle scaled 72;
L:=3Dlength p;
N:=3D20;
q:= =3Dsubpath (0,#1/N*L) of p;
draw q withcolor red;
fill fullcircle scal= ed 3 shifted point length q of q withcolor blue;
setb= ounds currentpicture to unitsquare shifted (-0.5,-0.5) scaled 75;
\stopMPco= de}

\starttext
\dostepwiserecurse{0}{20}{1}{%
\st= artTEXpage =
\MyG= raphics{\recurselevel}
\stopTEXpage}
\stoptext

Regards,=A0Bostjan

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. =A0In
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. =A0I am looking for a
"ConTeXt way" without placing the MetaPost code in a separate sou= rce
file, running MetaPost, and using \externalfigure. =A0The following
MetaPost sample code generate 21 graphics images =A0(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:=3Dfullcircle scaled 72;
L:=3Dlength p;
N:=3D20;
for n=3D0 upto N:
=A0 =A0 =A0 =A0beginfig(n);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0q:=3Dsubpath (0,n/N*L) of p;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0draw q withcolor red;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fill fullcircle scaled 3 shifted point leng= th q of q withcolor blue;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0setbounds currentpicture to unitsquare shif= ted (-0.5,-0.5) scaled 75;
=A0 =A0 =A0 =A0endfig;
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 t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =A0: http://= www.pragma-ade.nl / http://tex.aanhet.net
archive =A0: http://foundry.supelec.fr/projects/contextrev/
wiki =A0 =A0 : http:= //contextgarden.net
___________________________________________________________________________= ________

--0016e659fc0cef8f74048455ab48-- --===============0705699565== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0705699565==--