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
|
\documentclass{article}
\usepackage[inline]{asymptote}
%\usepackage{asymptote}
\usepackage{animate}
\begin{document}
Here is an inline 3D PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
asy inlinemovie
pdflatex inlinemovie
\end{verbatim}
\begin{center}
\begin{asy}
settings.render=4;
settings.prc=false;
import graph3;
import animate;
currentprojection=orthographic(1,-2,0.5);
currentlight=Headlamp;
animation A=animation("movie3");
int n=20;
for(int i=0; i < n; ++i) {
picture pic;
size3(pic,12cm,12cm,8cm);
limits((-2,-2,-2),(2,2,2));
real k=i/n*pi;
real f(pair z) {return 4cos(abs(z)-k)*exp(-abs(z)/6);}
draw(pic,surface(f,(-4pi,-4pi),(4pi,4pi),Spline),paleblue);
draw(pic,shift(i*6Z/n)*unitsphere,yellow);
A.add(pic);
}
label(A.pdf("autoplay,loop",delay=20,keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[autoplay,loop]{50}{movie3}{}{}
\end{center}
\end{document}
|