ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: MetaPost Animations
@ 2013-01-01  3:50 Jeong Dal
  2013-01-01  7:48 ` Wolfgang Schuster
  0 siblings, 1 reply; 27+ messages in thread
From: Jeong Dal @ 2013-01-01  3:50 UTC (permalink / raw)
  To: ntg-context

Dear Wolfgang,

Thank you for the explanation, and your sample works nicely.

I  enclosed \processMPbuffer using \startframe and \stopframe as following.
Then  I got a 'undefined control sequence' error.
If I use '\framed[]' instead of '\startframe … \stopframe', then it gave all 7 circles of different radius in two pages without error.
If I add "\startanimation … \stopanimation", the only change is the appearance of menu at the bottom of the last circle.(no animation)

What is wrong in the code?

Best regards,

Dalyoung


Happy New Year to all listers!!!


%%%%%%%%%%%%
\startbuffer[circles]
	path p;
	numeric n, u;
	u := 1cm;
	n:=\recurselevel*u;
	p := fullcircle scaled n;
	draw p;
	\stopbuffer

\usemodule[animation]
\setupinteraction[state=start]

\starttext
	%\startanimation[menu=yes]
	\dorecurse{7}{
	\startframe
	%	\framed[]%{\processMPbuffer[circles]}}
	\processMPbuffer[circles]
	\stopframe
	}
	%\stopanimation
\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

! Undefined control sequence.
system > tex > error on line 23 in file test-ani.tex: Undefined control sequence ...
13 \setupinteraction[state=start]
14
15 \starttext
16
17 %\startanimation[menu=yes]
18 \dorecurse{7}{
19 \startframe
20 %	\framed[]%{\processMPbuffer[circles]}}
21 \processMPbuffer[circles]
22 \stopframe
23 >> }
24 %\stopanimation
25
26 \stoptext
27
\12>>1 #1#2-> \startframe
\processMPbuffer [circles] \stopframe
\syst_helpers_recurse_indeed_yes ...curse_content
\syst_helpers_recurse_indeed
<to be read again>
{
<inserted text>
2
\syst_helpers_recurse_indeed ...the \innerrecurse
}{#2}
l.23 }




___________________________________________________________________________________
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] 27+ messages in thread
* Re: MetaPost Animations
@ 2013-01-01 14:30 Jeong Dal
  2013-01-01 15:35 ` Wolfgang Schuster
  0 siblings, 1 reply; 27+ messages in thread
From: Jeong Dal @ 2013-01-01 14:30 UTC (permalink / raw)
  To: ntg-context

Dear Wolfgang,

Thank you for the explanation and the correction of the code.

It works nicely. It also taught me some other things too.

I'd like to ask you one more thing.
When you update the animation module, would you please concern the location of the menu?
I think that it is better to put it at the bottom center of the animation frame in default?  
Currently, it is located slightly left from the center.

Thanks again.

Best regards,

Dalyoung
___________________________________________________________________________________
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] 27+ messages in thread
* Re: MetaPost Animations
@ 2012-12-30 13:19 Jeong Dal
  2012-12-30 13:43 ` Wolfgang Schuster
  0 siblings, 1 reply; 27+ messages in thread
From: Jeong Dal @ 2012-12-30 13:19 UTC (permalink / raw)
  To: ntg-context

Dear Troy,

The animations are impressive and thank you for sharing the code.

In the creation of many pdf for animation, it changes the recurselevel only.
 I wonder if there is a way to make such kind of animation in ConTeXt using Wolfgang's animation module.
Then we can include the animation in PDF output directly.

Here is my trial.

I modified it as following and got an animation. But it is only good for a few step animation.

%%%%%%%%%
\startbuffer[base]
N:=64;%\N;
u:=136;
pair f;
c:=2/(1+sqrt(5));%\c;
if c<1: f:=(1+-+c,0); v:=u/2; else: f:=(0,1+-+(1/c)); v:=u/c/2; fi; % Focus f is defined
path p,q;
pair z;
picture base;
numeric L;
p:=fullcircle yscaled c; % This is the ellipse
L:=length p;
draw p scaled (2*v) withpen pencircle scaled (v/260) dashed evenly; % Draw the ellipse dashed (will be traced later)
base:= currentpicture;
q:=bbox currentpicture enlarged (v/64); % Enlarge the bounding box slightly
q:=(llcorner q+(-v/128,-v/128))--(lrcorner q+(v/128,-v/128))--(urcorner q+(v/128,v/128))--(urcorner q+(-v/128,v/128))--cycle;
fill fullcircle scaled (v/32) shifted (f*v) withcolor red; % Focus
fill fullcircle scaled (v/32) shifted (-f*v) withcolor red; % Focus
base:=currentpicture; % Save this picture to draw in every frame
setbounds currentpicture to q; % Set the bounding box as described before
\stopbuffer

\startbuffer[fig1]
%	 \startMPpage
n:=1;%\recurselevel%1;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled (v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same for each frame
%	 \stopMPpage
\stopbuffer

\startbuffer[fig2]
%	 \startMPpage
n:=2;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled (v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same for each frame
%	 \stopMPpage
\stopbuffer

\startbuffer[fig3]
%	 \startMPpage
n:=3;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled (v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same for each frame
%	 \stopMPpage
\stopbuffer

\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]

{\processMPbuffer[base, fig1]}
{\processMPbuffer[base, fig2]}
{\processMPbuffer[base, fig3]}
\stopanimation
\stoptext

%%%%%%%%%%%%%

I also tried to simplify the code as following, but it just draw 10 figures not an animation.
Is there a way to combine them as an animation?

Thank you.

Best regards,

Dalyoung
 
%%%%%%%%%%%%%%%%%%%%%%%%%
\startbuffer[base]
N:=64;%\N;
u:=136;
pair f;
c:=2/(1+sqrt(5));%\c;
if c<1: f:=(1+-+c,0); v:=u/2; else: f:=(0,1+-+(1/c)); v:=u/c/2; fi; % Focus f is defined
path p,q;
pair z;
picture base;
numeric L;
p:=fullcircle yscaled c; % This is the ellipse
L:=length p;
draw p scaled (2*v) withpen pencircle scaled (v/260) dashed evenly; % Draw the ellipse dashed (will be traced later)
base:= currentpicture;
q:=bbox currentpicture enlarged (v/64); % Enlarge the bounding box slightly
q:=(llcorner q+(-v/128,-v/128))--(lrcorner q+(v/128,-v/128))--(urcorner q+(v/128,v/128))--(urcorner q+(-v/128,v/128))--cycle;
fill fullcircle scaled (v/32) shifted (f*v) withcolor red; % Focus
fill fullcircle scaled (v/32) shifted (-f*v) withcolor red; % Focus
base:=currentpicture; % Save this picture to draw in every frame
setbounds currentpicture to q; % Set the bounding box as described before
\stopbuffer

\startbuffer[fig1]
%	 \startMPpage
n:=\recurselevel;
draw base; % Draw the common picture saved above
draw subpath (0,(n-1)/(N-1)*L) of p scaled (2*v) withpen pencircle scaled (v/130) withcolor blue; % Trace the ellipse in blue
z:=point ((n-1)/(N-1)*L) of p scaled v; % The point on the ellipse where we are thusfar
fill fullcircle scaled (v/32) shifted (2*z) withcolor blue; % Draw the point
draw (-f*v)--(2*z)--(f*v) withpen pencircle scaled (v/260); % Draw the string used to trace the ellipse
setbounds currentpicture to q; % Set the bounding box so that it is the same for each frame
%	 \stopMPpage
\stopbuffer

\setupinteraction[state=start]
\usemodule[animation]
\starttext
\startanimation[menu=yes]
\dorecurse{10}{
{\processMPbuffer[base, fig1]}}
%{\processMPbuffer[base, fig2]}
%{\processMPbuffer[base, fig3]}
\stopanimation
\stoptext
%%%%%%%
___________________________________________________________________________________
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] 27+ messages in thread
* MetaPost Animations
@ 2012-12-28 19:41 Troy Henderson
  2012-12-28 20:51 ` Otared Kavian
  2012-12-28 21:52 ` Hans Hagen
  0 siblings, 2 replies; 27+ messages in thread
From: Troy Henderson @ 2012-12-28 19:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users, MetaPost List


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

I've created several animations using MetaPost/ConTeXt, and I have also
created a webpage with these animations.  The URL to the page is

http://www.tlhiv.org/animations/

Feedback is appreciated, and if there is a particular animation that you
would like to see included, let me know and I will attempt to code them up
in MetaPost, provide the source code, and include them on the webpage.

Troy Henderson

[-- Attachment #1.2: Type: text/html, Size: 485 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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] 27+ messages in thread
* installing context
@ 2005-07-25 22:03 Stuart Jansen
  2005-07-25 22:10 ` Hans Hagen
  0 siblings, 1 reply; 27+ messages in thread
From: Stuart Jansen @ 2005-07-25 22:03 UTC (permalink / raw)



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

Okay, I give up. What's the most correct, easiest way to install ConTeXt
on Linux? There's so many different instructions floating around I'm not
sure what is authoritative. Some make it look like texsync is a good
idea, now it looks like it isn't being updated. Grabbing linuxtex.zip
seems easy, but it also looks like it isn't kept up-to-date. I've been
trying to follow minstall.pdf to install cont-tmf.zip, but that isn't
working either. Before I debug it anymore, I'd like to know: how should
I be making sure I have the latest version on Linux?

-- 
Stuart Jansen <sjansen@gurulabs.com>
Guru Labs, L.C.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2013-01-07 18:24 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-01  3:50 MetaPost Animations Jeong Dal
2013-01-01  7:48 ` Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2013-01-01 14:30 Jeong Dal
2013-01-01 15:35 ` Wolfgang Schuster
2013-01-07 16:22   ` Troy Henderson
2013-01-07 16:46     ` Marco Patzer
2013-01-07 17:47       ` Rogers, Michael K
2013-01-07 18:24     ` Alan BRASLAU
2012-12-30 13:19 Jeong Dal
2012-12-30 13:43 ` Wolfgang Schuster
2012-12-28 19:41 Troy Henderson
2012-12-28 20:51 ` Otared Kavian
2012-12-28 21:52 ` Hans Hagen
2012-12-28 23:18   ` Rogers, Michael K
2012-12-28 23:49     ` Troy Henderson
2012-12-29  1:02       ` Rogers, Michael K
2012-12-29  2:55         ` Troy Henderson
2012-12-29  3:49           ` Otared Kavian
2012-12-29  3:52             ` Troy Henderson
2012-12-29 12:47           ` Hans Hagen
2012-12-29 15:42           ` Mojca Miklavec
2012-12-29 16:40             ` Peter Münster
2012-12-29 17:07             ` Tom Fossen
2012-12-30  2:57             ` Troy Henderson
2012-12-30 12:43               ` Mojca Miklavec
2012-12-29 12:41         ` Hans Hagen
2005-07-25 22:03 installing context Stuart Jansen
2005-07-25 22:10 ` Hans Hagen
2005-07-26  4:41   ` Adam Lindsay
2005-07-26  5:58     ` metapost:animations luigi.scarso

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