ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Metapost animation
@ 2004-09-13 16:57 Michal Kvasnicka
  2004-09-13 17:14 ` Henning Hraban Ramm
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Michal Kvasnicka @ 2004-09-13 16:57 UTC (permalink / raw)


Good evening.

First of all I want to thank to Mr. Hagen for his last answer. I will 
check your last code of balanced columnsets at home (with the newest 
ConTeXt). As for your correcting code for ordinary collumns, I have 
tried it with three different types of my documents, and it worked well. 
Maybe this is the final solution of the problem. I will try it with more 
documents and let you know, anyway.

Now to my next question. I have seen a great thing: Metapost pictures 
were animated (probably with the JavaScript code). You can found some 
examples here:
    http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf
    http://www.math.muni.cz/~plch/nkpm/nradanm8.pdf
(Just click on the `Spustit animaci' button.)

Is it possible to do it simply in the ConTeXt? Of course I may break 
down the mechanism of widgets and write my own JavaScript (I don't know 
how to do timing), but isn't there some special macro for animating 
series of figures? It would be great.

If so, is Acrobat Reader fast enough to simulate this way the nice 
feature of MS PowerPoint---curves and shapes that are drawn by pieces, 
or that appear somewhere and then go to its final location? (This is 
quite instructive in economics, because you can easily notice which 
curve is drawn first, what second, and so on.) How can I do it?

With many greetings and thanks
Michal Kvasnicka

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-13 16:57 Metapost animation Michal Kvasnicka
@ 2004-09-13 17:14 ` Henning Hraban Ramm
  2004-09-13 19:40 ` Patrick Gundlach
  2004-09-14 16:33 ` Hans Hagen
  2 siblings, 0 replies; 18+ messages in thread
From: Henning Hraban Ramm @ 2004-09-13 17:14 UTC (permalink / raw)


Am 13.09.2004 um 18:57 schrieb Michal Kvasnicka:
> Now to my next question. I have seen a great thing: Metapost pictures 
> were animated (probably with the JavaScript code). You can found some 
> examples here:

Hans himself showed some examples some years ago at DANTE, a ticking 
clock, a spinning windmill etc.
(The clock is somewhere around AFAIK but works only with Acrobat 4)

Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-13 16:57 Metapost animation 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 16:33 ` Hans Hagen
  2 siblings, 1 reply; 18+ messages in thread
From: Patrick Gundlach @ 2004-09-13 19:40 UTC (permalink / raw)


Hi,

> Now to my next question. I have seen a great thing: Metapost pictures
> were animated (probably with the JavaScript code). You can found some
> examples here:

You need automatic steps? If not, take a look at 
http://dl.contextgarden.net/examples/euro-anim/euro-anim.pdf

(this is explained in the metafun handbook; I could upload the source,
too).


Patrick
-- 
ConTeXt wiki: http://contextgarden.net
texshow-web:  http://texshow.contextgarden.net
List archive: http://archive.contextgarden.net

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-14  8:27   ` Michal Kvasnicka
@ 2004-09-14  8:21     ` Patrick Gundlach
  0 siblings, 0 replies; 18+ messages in thread
From: Patrick Gundlach @ 2004-09-14  8:21 UTC (permalink / raw)


Hello Michal,

[...]

> As for your example, I don't understand it. It does work under Windoze
> with Acrobat 4.0 and Acrobat Reader 5.0, but not under Linux with
> Acrobat Reader 5.x. 

That is Acrobat Reader. :-( Accept it as a fact that you need to do
your JS for a specific version of Adobe Reader.


> Can you send me your source? I'd like to compile it myself and see
> whether it would work, or not. 

It is up at 
http://dl.contextgarden.net/examples/euro-anim/euro-anim.tex

> Have you any explanation for that?

None at all.

Patrick
-- 
ConTeXt wiki: http://contextgarden.net
texshow-web:  http://texshow.contextgarden.net
List archive: http://archive.contextgarden.net

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Re: Metapost animation
  2004-09-13 19:40 ` Patrick Gundlach
@ 2004-09-14  8:27   ` Michal Kvasnicka
  2004-09-14  8:21     ` Patrick Gundlach
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Kvasnicka @ 2004-09-14  8:27 UTC (permalink / raw)


Good morning.

Thanks for your answers.

Well, I'm searching for automatic steps. (I know that manual steps are 
covered in the widgets manual.) And even for more funny stuff, like 
curves that appear `per partes', or curves thats slide from somewhere to 
their final location.

>You need automatic steps? If not, take a look at 
>http://dl.contextgarden.net/examples/euro-anim/euro-anim.pdf
>
>  
>
As for your example, I don't understand it. It does work under Windoze 
with Acrobat 4.0 and Acrobat Reader 5.0, but not under Linux with 
Acrobat Reader 5.x. The same was true with Mr. Hagen's clock example. 
Why is it so? Can you send me your source? I'd like to compile it myself 
and see whether it would work, or not. Have you any explanation for that?

Well, my more questions I will rahter cover under another subject. :-)

Many thanks and greetings anyway.
M.K.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-13 16:57 Metapost animation Michal Kvasnicka
  2004-09-13 17:14 ` Henning Hraban Ramm
  2004-09-13 19:40 ` Patrick Gundlach
@ 2004-09-14 16:33 ` Hans Hagen
  2004-09-14 19:18   ` Michal Kvasnicka
  2 siblings, 1 reply; 18+ messages in thread
From: Hans Hagen @ 2004-09-14 16:33 UTC (permalink / raw)


Michal Kvasnicka wrote:

> Now to my next question. I have seen a great thing: Metapost pictures 
> were animated (probably with the JavaScript code). You can found some 
> examples here:
>    http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf
>    http://www.math.muni.cz/~plch/nkpm/nradanm8.pdf
> (Just click on the `Spustit animaci' button.)

it's in the metafun manual 

that kind of trickery has been present in context for a long time, but unfortunately it's not always available on each platform 

(apart from the fact that each version of acrobat has its own side effects) 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-14 16:33 ` Hans Hagen
@ 2004-09-14 19:18   ` Michal Kvasnicka
  2004-09-15  8:22     ` Hans Hagen
  0 siblings, 1 reply; 18+ messages in thread
From: Michal Kvasnicka @ 2004-09-14 19:18 UTC (permalink / raw)


Hans Hagen wrote:

> Michal Kvasnicka wrote:
>
>> Now to my next question. I have seen a great thing: Metapost pictures 
>> were animated (probably with the JavaScript code). You can found some 
>> examples here:
>>    http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf
>>    http://www.math.muni.cz/~plch/nkpm/nradanm8.pdf
>> (Just click on the `Spustit animaci' button.)
>
>
> it's in the metafun manual
> that kind of trickery has been present in context for a long time, but 
> unfortunately it's not always available on each platform
> (apart from the fact that each version of acrobat has its own side 
> effects)

Hm. Do you quote the Metafun manual, section 13.6? I know this 
technique. But my question was different: Is it possible to `animate' 
the fieldstack? In other words, to make it change one figure to another 
automatically, without clicking anywhere, changing one frame to another 
each 1/n second to simulate a smoth motion like in a cinema?

Many thanks to you and all who answered me.
Yours
Michal Kvasnicka

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  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
  0 siblings, 2 replies; 18+ messages in thread
From: Hans Hagen @ 2004-09-15  8:22 UTC (permalink / raw)


Michal Kvasnicka wrote:

> Hm. Do you quote the Metafun manual, section 13.6? I know this 
> technique. But my question was different: Is it possible to `animate' 
> the fieldstack? In other words, to make it change one figure to 
> another automatically, without clicking anywhere, changing one frame 
> to another each 1/n second to simulate a smoth motion like in a cinema?

sure, you can let a javascript toggle the states; however, small steps (<1 sec) are not to be trusted in precission, since they also depend on the machine; they also kind of block other actions since there is no concept of animation in pdf (apart from svg, which is poorly implemented/integrated).   

Another method is demonstrated in the 'dante XV' presentation (runs slightly faster on a mac than on windows); 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2004-09-15  8:22     ` Hans Hagen
@ 2004-09-16 17:05       ` Michal Kvasnicka
  2005-05-19 14:28       ` Mojca Miklavec
  1 sibling, 0 replies; 18+ messages in thread
From: Michal Kvasnicka @ 2004-09-16 17:05 UTC (permalink / raw)


Good evening.

Many thanks for your answer. If it doesn't work for `small steps (<1s)', 
it's probably useless, since for a smooth motion at least 15 frames per 
seconds are needed. But anyway, what is `svg'? Where can I see `dante XV 
presentation'?

And one more question: Is sounds as system-dependent as movies? If not, 
how can I integrate it in a PDF document?

Many thanks and greetings.
Yours
Michal Kvasnicka

>
> sure, you can let a javascript toggle the states; however, small steps 
> (<1 sec) are not to be trusted in precission, since they also depend 
> on the machine; they also kind of block other actions since there is 
> no concept of animation in pdf (apart from svg, which is poorly 
> implemented/integrated).  
> Another method is demonstrated in the 'dante XV' presentation (runs 
> slightly faster on a mac than on windows);
> Hans 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  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
  1 sibling, 1 reply; 18+ messages in thread
From: Mojca Miklavec @ 2005-05-19 14:28 UTC (permalink / raw)



Hans Hagen wrote:
> Michal Kvasnicka wrote:
> 
>> Hm. Do you quote the Metafun manual, section 13.6? I know this 
>> technique. But my question was different: Is it possible to `animate' 
>> the fieldstack? In other words, to make it change one figure to 
>> another automatically, without clicking anywhere, changing one frame 
>> to another each 1/n second to simulate a smoth motion like in a cinema? 
> 
> sure, you can let a javascript toggle the states; however, small steps 
> (<1 sec) are not to be trusted in precission, since they also depend on 
> the machine; they also kind of block other actions since there is no 
> concept of animation in pdf (apart from svg, which is poorly 
> implemented/integrated).  
> Another method is demonstrated in the 'dante XV' presentation (runs 
> slightly faster on a mac than on windows);
> Hans

Can someone please post any example of JavaScript code to "toggle the 
states" like in either http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf 
or https://www.pragma-pod.com/present/talks/fifteen.pdf?

I produced the graphics as explained in the section 13.6 of the metafun 
manual, but I would like to press the button only once at the beginning 
of the animation instead of twenty times.

Thank you very much,
	Mojca Miklavec

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Metapost animation
  2005-05-19 14:28       ` Mojca Miklavec
@ 2005-05-19 14:39         ` luigi.scarso
  0 siblings, 0 replies; 18+ messages in thread
From: luigi.scarso @ 2005-05-19 14:39 UTC (permalink / raw)


Mojca Miklavec wrote:

>
> Can someone please post any example of JavaScript code to "toggle the 
> states" like in either http://www.math.muni.cz/~plch/nkpm/nradanm6.pdf 
> or https://www.pragma-pod.com/present/talks/fifteen.pdf?
>
I hope this can help you:

http://www.fi.muni.cz/~xholecek/animations/

luigi

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: MetaPost Animation
  2010-04-16 12:51     ` Troy Henderson
  2010-04-16 14:19       ` Boštjan Vesnicer
@ 2010-04-16 14:43       ` Wolfgang Schuster
  1 sibling, 0 replies; 18+ messages in thread
From: Wolfgang Schuster @ 2010-04-16 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 16.04.10 14:51, schrieb Troy Henderson:
> If I have two different \startMPcode ... \stopMPcode sections, is
> there a way (perhaps it does this by default) to have the variables
> stored in the first block available in the second block?  In pure
> MetaPost, I can do
>
> numeric a:=4;
> beginfig(1);
>      label(decimal(a),origin);
> endfig;
> beginfig(2);
>      label(decimal(a),origin);
> endfig;
> end
>
> and both figures have the value of 'a' available to them because 'a'
> was defined before each figure.  What is the ConTeXt way of doing
> this?
>    
\starttext
\startluacode
local a = 0
for i=1,10 do
     a = a + 1
     context.startMPpage()
         -- context('label("%d",origin);',a)
         context('label(textext("%d"),origin);',a)
     context.stopMPpage()
end
\stopluacode
\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: MetaPost Animation
  2010-04-16 12:51     ` Troy Henderson
@ 2010-04-16 14:19       ` Boštjan Vesnicer
  2010-04-16 14:43       ` Wolfgang Schuster
  1 sibling, 0 replies; 18+ messages in thread
From: Boštjan Vesnicer @ 2010-04-16 14:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 711 bytes --]

>
> If I have two different \startMPcode ... \stopMPcode sections, is
> there a way (perhaps it does this by default) to have the variables
> stored in the first block available in the second block?  In pure
> MetaPost, I can do
>
> numeric a:=4;
> beginfig(1);
>    label(decimal(a),origin);
> endfig;
> beginfig(2);
>    label(decimal(a),origin);
> endfig;
> end
>
> and both figures have the value of 'a' available to them because 'a'
> was defined before each figure.  What is the ConTeXt way of doing
> this?
>
>
Do you mean something like this?

\starttext
\startMPpage
a := 4;
label(decimal a, origin);
\stopMPpage
\startMPpage
a := a+1;
label(decimal a, origin);
\stopMPpage
\stoptext

Regards, Bostjan

[-- Attachment #1.2: Type: text/html, Size: 1412 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: MetaPost Animation
  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
  0 siblings, 2 replies; 18+ messages in thread
From: Troy Henderson @ 2010-04-16 12:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

>> \def\MyGraphics#1{%

Thanks for the replies folks.  The example that I posted is a simple
example.  The example that I'm working on (displaying successive terms
in a Taylor series) requires a bit of computations, and I don't want
to have to go back and do each computation for each value of #1.  That
is, I want to build a table of numerical values (numeric Y[][]) and be
able to address those values from my \startMPcode section.

If I have two different \startMPcode ... \stopMPcode sections, is
there a way (perhaps it does this by default) to have the variables
stored in the first block available in the second block?  In pure
MetaPost, I can do

numeric a:=4;
beginfig(1);
    label(decimal(a),origin);
endfig;
beginfig(2);
    label(decimal(a),origin);
endfig;
end

and both figures have the value of 'a' available to them because 'a'
was defined before each figure.  What is the ConTeXt way of doing
this?

Thanks,

Troy
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: MetaPost Animation
  2010-04-16  7:36 ` Boštjan Vesnicer
@ 2010-04-16  7:54   ` Hans Hagen
  2010-04-16 12:51     ` Troy Henderson
  0 siblings, 1 reply; 18+ messages in thread
From: Hans Hagen @ 2010-04-16  7:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 16-4-2010 9:36, Boštjan Vesnicer wrote:
> 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

or, if you want to fool yourself that you're not using tex ... put this 
in "somefile.cld":

-- --

local template = [[
     path p, q ;
     p := fullcircle scaled 72 ;
     L := length p ;
     N := 20 ;
     q:=subpath (0,%s/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 ;
]]

context.starttext()
     for i=0,20 do
         context.startMPpage()
             context(template,i)
         context.stopMPpage()
     end
context.stoptext()

-- --

and then run:

context somefile.cld




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: MetaPost Animation
  2010-04-15 17:53 MetaPost Animation Troy Henderson
@ 2010-04-16  7:36 ` Boštjan Vesnicer
  2010-04-16  7:54   ` Hans Hagen
  0 siblings, 1 reply; 18+ messages in thread
From: Boštjan Vesnicer @ 2010-04-16  7:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 18+ messages in thread

* MetaPost Animation
@ 2010-04-15 17:53 Troy Henderson
  2010-04-16  7:36 ` Boštjan Vesnicer
  0 siblings, 1 reply; 18+ messages in thread
From: Troy Henderson @ 2010-04-15 17:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Metapost animation
  2005-03-31 11:53   ` Thomas A.Schmitz
@ 2005-03-31 12:50     ` Albrecht Kauffmann
  0 siblings, 0 replies; 18+ messages in thread
From: Albrecht Kauffmann @ 2005-03-31 12:50 UTC (permalink / raw)



Hi Hans, hi all,

in an former mail you had answered to the question of Michal Kvasnicka:
"Is it possible to `animate'
> the fieldstack? In other words, to make it change one figure to
> another automatically, without clicking anywhere, changing one frame
> to another each 1/n second to simulate a smoth motion like in a
cinema?":

"sure, you can let a javascript toggle the states, ...".

Has someone already experience with such animated field stacks and can
give me some clue how to realize this?

With many thanks in advance
Albrecht

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-04-16 14:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13 16:57 Metapost animation 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
     [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
2010-04-15 17:53 MetaPost Animation Troy Henderson
2010-04-16  7:36 ` Boštjan Vesnicer
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

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).