summaryrefslogtreecommitdiff
path: root/Master/texmf/doc/asymptote/examples/animations/inlinemovie.tex
blob: 3fa61b6673bd27a616b9a52249d9cc553c019ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\documentclass{article}
\usepackage[inline]{asymptote}
%\usepackage{asymptote}
\usepackage{animate}
\begin{document}

Here is an inline PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
asy inlinemovie
pdflatex inlinemovie
\end{verbatim}

\begin{center}
\begin{asy}
import animate;
animation A=animation("movie1");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(i*h)--expi((i+1)*h));
  A.add(pic);
}
label(A.pdf("controls",delay=50,keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls,loop]{20}{movie1}{}{}
\end{center}

And here is another one, clickable but without the control panel:
\begin{center}
\begin{asy}
import animate;
animation A=animation("movie2");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(-i*h)--expi(-(i+1)*h),red);
  A.add(pic);
}
label(A.pdf(keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls,loop]{10}{movie2}{}{}
\end{center}

\end{document}