diff options
Diffstat (limited to 'Master/texmf/doc/asymptote/examples/animations')
5 files changed, 39 insertions, 13 deletions
diff --git a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy index abd8ac9f431..08c578d86d2 100644 --- a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy +++ b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy @@ -9,7 +9,7 @@ settings.prc=false; settings.thick=false; settings.outformat="mpg"; currentprojection=orthographic(5,4,2); -currentlight=light(specular=black,(0.1,-0.1,1)); +currentlight=light(specular=black,(0.1,-0.1,1),viewport=true); size(15cm,0); @@ -23,17 +23,17 @@ real xST(real t) {return ast*cos(t)+cst;} real yST(real t) {return bst*sin(t);} real zST(real t) {return 0;} -real xTL(real t) {return atl*cos(27*t);} -real yTL(real t) {return btl*sin(27*t);} +real xTL(real t) {return atl*cos(27t);} +real yTL(real t) {return btl*sin(27t);} real zTL(real t) {return 0;} -real xLl(real t) {return Rl*cos(27*t);} -real yLl(real t) {return Rl*sin(27*t);} +real xLl(real t) {return Rl*cos(27t);} +real yLl(real t) {return Rl*sin(27t);} real zLl(real t) {return 0;} -real xTt(real t) {return Rtl*cos(100*(t))/5;} -real yTt(real t) {return Rtl*sin(100*(t))/5;} +real xTt(real t) {return Rtl*cos(100t)/5;} +real yTt(real t) {return Rtl*sin(100t)/5;} real zTt(real t) {return 0;} real xl(real t) {return xST(t)+xTL(t)+xLl(t);} @@ -48,8 +48,8 @@ real xL(real t) {return xST(t)+xTL(t);} real yL(real t) {return yST(t)+yTL(t);} real zL(real t) {return 0;} -path3 Pl=graph(xl,yl,zl,0,2*pi,1000),Pt=graph(xt,yt,zt,0,2*pi,3000), -Pts=graph(xST,yST,zST,0,2*pi,500); +path3 Pl=graph(xl,yl,zl,0,2pi,1000),Pt=graph(xt,yt,zt,0,2pi,3000), +Pts=graph(xST,yST,zST,0,2pi,500); picture pic; @@ -63,6 +63,7 @@ surface terre=scale3(Rtl/5)*unitsphere; surface lune=scale3(Rl)*unitsphere; int n=100; + real step=2pi/n; for(int i=0; i < n; ++i) { real k=i*step; diff --git a/Master/texmf/doc/asymptote/examples/animations/glmovie.asy b/Master/texmf/doc/asymptote/examples/animations/glmovie.asy new file mode 100644 index 00000000000..c3d86481b1b --- /dev/null +++ b/Master/texmf/doc/asymptote/examples/animations/glmovie.asy @@ -0,0 +1,21 @@ +settings.autoplay=true; +settings.loop=true; + +import graph3; +import animate; +currentprojection=orthographic(1,-2,0.5); + +animation A; +int n=25; + +for(int i=0; i < n; ++i) { + picture pic; + size3(pic,6cm); + 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); +} + +A.glmovie(); diff --git a/Master/texmf/doc/asymptote/examples/animations/inlinemovie3.tex b/Master/texmf/doc/asymptote/examples/animations/inlinemovie3.tex index c46a17d3e59..4cd9cce3150 100644 --- a/Master/texmf/doc/asymptote/examples/animations/inlinemovie3.tex +++ b/Master/texmf/doc/asymptote/examples/animations/inlinemovie3.tex @@ -19,13 +19,12 @@ settings.prc=false; import graph3; import animate; currentprojection=orthographic(1,-2,0.5); -currentlight=(1,1,20); + 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); diff --git a/Master/texmf/doc/asymptote/examples/animations/sphere.asy b/Master/texmf/doc/asymptote/examples/animations/sphere.asy index e6bcb589add..56c5f73e3b6 100644 --- a/Master/texmf/doc/asymptote/examples/animations/sphere.asy +++ b/Master/texmf/doc/asymptote/examples/animations/sphere.asy @@ -3,7 +3,9 @@ import animation; currentprojection=orthographic((0,5,2)); currentlight=(0,5,5); + settings.thick=false; +settings.render=0; int nbpts=200; real step=2*pi/nbpts; diff --git a/Master/texmf/doc/asymptote/examples/animations/torusanimation.asy b/Master/texmf/doc/asymptote/examples/animations/torusanimation.asy index 9073ab2b56a..8370a0c25af 100644 --- a/Master/texmf/doc/asymptote/examples/animations/torusanimation.asy +++ b/Master/texmf/doc/asymptote/examples/animations/torusanimation.asy @@ -26,8 +26,11 @@ for(int i=0; i < n; ++i) { p[i]=graph(g,0,1,operator ..); } -revolution torus=revolution(shift(R*X)*Circle(O,a,Y,32),Z); -surface s=surface(torus); +triple f(pair t) { + return ((R+a*cos(t.y))*cos(t.x),(R+a*cos(t.y))*sin(t.x),a*sin(t.y)); +} + +surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline); for(int i=0; i < n; ++i){ picture fig; |