[pstricks] draw animation by tikZ

Alexander Grahn A.Grahn at fzd.de
Fri Sep 19 10:17:39 CEST 2008


On Fri, Sep 19, 2008 at 09:41:48AM +0200, Herbert Voss wrote:
>and the same with PSTricks
>
>Herbert
>
>
>\documentclass{article}
>\usepackage{animate}
>\usepackage{pstricks-add}
>\usepackage{multido}
>\begin{document}
>  %-------------------- write timeline file ---------------------%
>  \newwrite\TimeLineFile
>  \immediate\openout\TimeLineFile=sinus.txt
>  \immediate\write\TimeLineFile{::0x0,1}%
>  %remaining frames: overlay filled circle at its current postion
>  \multido{\i=2+1}{90}{%
>    \immediate\write\TimeLineFile{%
>      ::\i % put filled circle on top
>  }}
>  \immediate\closeout\TimeLineFile
>  %------------------- assemble animation -----------------------%
>  \psset{xunit=\pstRadUnit}
>  \begin{animateinline}[controls,timeline=sinus.txt,
>    begin={\begin{pspicture}(-0.5,-1.5)(6.6,2)},
>    end={\end{pspicture}}]{9}
>    %---- static material: axes, labels, curve ----%
>
>\psaxes[trigLabels,trigLabelBase=3]{->}(0,0)(-2mm,-1.5)(6.5,1.5)[t,-90][$y=\sin(t)$,0]
>    \psplot[xunit=1cm,linestyle=dashed,algebraic]{0}{\psPiTwo}{sin(x)}
>    \newframe
>    \multiframe{91}{n=0+4}{\psset{xunit=1cm,linecolor=blue}
>      \psdot[dotsize=3mm](!\n\space dup DegtoRad exch sin)
>      \psline[linestyle=dashed](!\n\space dup DegtoRad exch
>sin)(!\n\space DegtoRad 0)
>    }
>  \end{animateinline}
>\end{document}

Looks great, Herbert! With the doubled number of frames the animation
is much smoother. However, to see the difference you should increase
the FPS setting in the PSTricks example to 24 instead of reducing it.

There is even buffer to further increase the speed. With your enhanced
example I get upto about 63 fps (command option `measure') (Reader-8.1.2,
Linux, Core(TM)2 CPU 6600 @ 2.40GHz, nVidia NV44 [Quadro NVS 285])

Alexander



More information about the PSTricks mailing list