Debian Codegraph @

texmf-dist/doc/latex/visualpstricks/Source/anim.tex

raw
1 \label{anim}
2 \SbSSCT{Animation à partir de fichiers d'image }{Animation from picture files}
3
4 %\begin{verbatim}\animategraphics[<options>]{<frame rate>}{<file basename>}{<first>}{<last>} \end{verbatim}
5
6
7 \begin{tabular}{|c|c|} \hline
8 \TFRGB{première image}{first frame} & \TFRGB{second et dernière image}{second and last frame}
9 \\ \hline
10 \includegraphics{XXX1.ps}
11 &
12 \includegraphics{XXX2.ps}
13 \\
14 \hline \BS{includegraphics}\AC{XXX1.ps} & \BS{includegraphics}\AC{XXX2.ps}\\
15 \hline
16 \end{tabular}
17
18
19
20 %
21 \begin{minipage}{7cm}
22 \animategraphics[controls,loop,autoplay]{4}{XXX}{1}{2}
23 \end{minipage}\hfill
24 \begin{minipage}{7cm}
25 \begin{tabular}{|l@{:}l|}
26 \hline \BSS{animategraphics} & \\
27 \hline [ controls, & \TFRGB{boutons de contrôle}{Inserts control buttons} \\
28 \hline loop & \TFRGB{en boucle}{animation restarts automatically}\\
29 \hline autoplay ] & \TFRGB{auto demarrage}{Start animation automatically } \\
30 \hline \AC{4} & \TFRGB{4 fois par seconde}{4 frame per second}\\
31 \hline \AC{XXX} & \TFRGB{base du nom fichier}{file base name} \\
32 \hline \AC{1} & \TFRGB{numero de debut}{number of the first frame} \\
33 \hline \AC{2} & \TFRGB{numeo de fin}{number of the last frame} \\
34 \hline
35 \end{tabular}
36
37 \end{minipage}
38
39 %--------------------------------------------------------------
40 \subsection{Animateinline}
41
42
43 \begin{minipage}{7cm}
44 \begin{center}
45 \begin{animateinline}[ controls,loop,autoplay]{5}%
46 \begin{pspicture}(6,6)
47 \psdiamond*[gangle=45](3,3)(2,.5)
48 \psdiamond*[gangle=135](3,3)(2,.5)
49 \end{pspicture}
50 \newframe%
51 \begin{pspicture}(6,6)
52 \psdiamond*[gangle=0](3,3)(2,.5)
53 \psdiamond*[gangle=90](3,3)(2,.5)
54 \end{pspicture}
55 \end{animateinline}%
56 \end{center}
57 \end{minipage}\hfill
58 \begin{minipage}{7cm}
59 \BSS{begin\AC{animateinline}}[controls,loop,autoplay]\AC{5} \\
60
61 \emph{\% \TFRGB{première image}{first frame }}\\
62 \BS{begin}\AC{pspicture}(6,6) \\
63 \BS{psdiamond*}[gangle=45](3,3)(2,.5) \\
64 \BS{psdiamond*}[gangle=135](3,3)(2,.5) \\
65 \BS{end}\AC{pspicture} \\
66
67 \emph{\% \TFRGB{deuxième}{second frame }}\\
68 \BSS{newframe} \\
69 \BS{begin}\AC{pspicture}(6,6) \\
70 \BS{psdiamond*}[gangle=0](3,3)(2,.5) \\
71 \BS{psdiamond*}[gangle=90](3,3)(2,.5) \\
72 \BS{end}\AC{pspicture} \\
73 \\
74 \BSS{end\AC{animateinline}} \\
75 \end{minipage}
76 %
77 %%------------------------------------------------------------------------
78 %\newpage
79 \subsection{Multiframe}
80
81 \begin{minipage}{7cm}
82 \begin{center}
83 \begin{animateinline}[poster=first, controls, palindrome,autoplay]{12}%
84 \multiframe{29}{iAngle=80+10,Rdim=2.0+-0.2}{\begin{pspicture}(6,6)
85 \psdiamond*[gangle=\iAngle](3,3)(\Rdim,.5)
86 \rput(1,1){\iAngle}
87 \rput(5,1){\Rdim}
88 \end{pspicture} }%
89 \end{animateinline}%
90 \end{center}
91 \end{minipage}\hfill
92 \begin{minipage}{7cm}
93
94 \BS{begin}\AC{animateinline}[poster=first,controls, palindrome]\AC{12} \\
95 \BSS{multiframe}\AC{29}\AC{{\red iAngle}=80+10, {\red Rdim}=2.0+-0.2}\AC{ \\
96 \BS{begin}\AC{pspicture}(6,6) \\
97 \BS{psdiamond*}[gangle={\red \BS{iAngle}}](3,3)({\red \BS{Rdim}},.5)\\
98 \BS{rput}(1,1)\AC{{\red \BS{iAngle}}} \\
99 \BS{rput}(5,1)\AC{{\red \BS{Rdim}}} \\
100 \BS{end}\AC{pspicture} } \\
101 \BS{end}\AC{animateinline}%
102
103
104 \end{minipage}
105 \bigskip
106
107 \TFRGB{L'initiale de la variable définit son type}{The first letter of the variable name determines his type }
108
109 \begin{tabular}{|c|l|}
110 \hline entier & initiale : i ou I \\
111 \hline réelles & initiale : n, N, r ou R \\
112 \hline longueurs & initiale : d ou D \\
113 \hline
114 \end{tabular}
115 %%---------------------------------------------------------------------------------
116 \newpage
117 \subsection{Timeline}
118
119 \begin{minipage}{6.5cm}
120 \begin{animateinline}[controls,autoplay,timeline=xxx.txt]{5}%
121 \begin{pspicture}(6,6)
122 \pscircle[fillcolor=yellow,fillstyle=solid](3,3){2.5}
123 \end{pspicture}
124 \newframe%
125 \begin{pspicture}(6,6)
126 \pscircle[linecolor=red,fillcolor=green,fillstyle=solid](3,3){2.5}
127 \end{pspicture}
128 \newframe
129 \multiframe{10}{iAngle=60+10}{\begin{pspicture}(6,6)
130 \psdiamond*[gangle=\iAngle](3,3)(2,.5)
131 \end{pspicture} }%
132 \end{animateinline}%
133
134 \end{minipage}\hfill
135 \begin{minipage}{8cm}
136
137 \BS{begin}\AC{animateinline}
138
139 [controls,autoplay,\RDD{timeline}=xxx.txt]\AC{5} \\
140
141 \emph{\% \TFRGB{1 image de fond}{}first background image (image \No 0)} \\
142 \BS{begin}\AC{pspicture}(6,6) \\
143 \BS{pscircle}[fillcolor=yellow,fillstyle=solid](3,3)\AC{2.5} \\
144 \BS{end}\AC{pspicture} \\
145
146 \textbf{\BS{newframe}} \emph{\% \TFRGB{2 page de fond}{second background image } (image \No 1)} \\
147 \BS{begin}\AC{pspicture}(6,6) \\
148 \BS{pscircle}[linecolor=red,fillcolor=green,fillstyle=solid](3,3)\AC{2.5} \\
149 \BS{end}\AC{pspicture} \\
150
151 \textbf{\BS{newframe}} \emph{\% \TFRGB{animation}{animation frames} (images \No 2 - 11) } \\
152 \BS{multiframe}\AC{10}\AC{iAngle=60+10}\AC{ \\
153 \BS{begin}\AC{pspicture}(6,6) \\
154 \BS{psdiamond*}[gangle=\BS{iAngle}](3,3)(2,.5) \\
155 \BS{end}\AC{pspicture} } \\
156 \BS{end}\AC{animateinline} \\
157 \end{minipage}
158
159 \bigskip
160 \SbSbSSCT{Création du fichier pour timeline}{ Creation of the file for timeline}
161
162 \TFRGB{Pour créer le fichier xxx.txt , en insérant le code suivant avant}{to create the file xxx.txt, insert the following code before } \BS{begin\AC{document}}
163 \bigskip
164
165 \begin{minipage}{7cm}
166 \BSS{begin\AC{filecontents}}\AC{xxx.txt} \\
167 ::\Rnode{A}{0x0,8} \\
168 ::2 \\
169 ::7 \\
170 ::3 \\
171 ::6 \\
172 ::\Rnode{B}{c,1x3,5} \\
173 ::4 \\
174 ::11 \\
175 ::5 \\
176 ::7 \\
177 ::9 \\
178 \BSS{end\AC{filecontents}}
179 \end{minipage}\hfill
180 \begin{minipage}{7cm}
181 \rnode{AA}{0x0 : image \No 0 \TFRGB{sert de fond tout le temps}{= background image for all frame}} \\
182
183 \vspace{.5cm}
184 \Rnode{BB}{c : \TFRGB{efface les images précédentes}{clear the background image} } \\
185
186 \vspace{.5cm}
187 \Rnode{CC}{1x3 : image \No 1 \TFRGB{sert de fond 3 fois}{= background image for 3 frames}} \\
188
189 \vspace{.5cm}
190 \TFRGB{Ordre de passage des images}{ Order of frames} : 8,2,7,3,6,5,4,11,5,7,9
191 \end{minipage}
192 \ncline[linecolor=blue]{A}{AA} \ncline[linecolor=blue]{B}{BB} \ncline[linecolor=blue]{B}{CC}
193
194 \SbSbSSCT{option pour le fichier xxx.txt}{option for the file xxx.txt}
195
196 \begin{tabular}{|c|l|} \hline
197 * : : 3
198 &
199 \TFRGB{pause à l'image}{pause at frame } \No 3
200 \\ \hline
201 : 10 : 3
202 &
203 \TFRGB{vitesse 10 par seconde à l'image}{10 frames per second at frame} \No 3
204 \\ \hline
205 : : 3 : code
206 &
207 \TFRGB{code java possible à l'image}{java code at frame} \No 3
208 \\ \hline
209 \end{tabular}
210
211 \newpage
212 \SbSSCT{Animation d'un graphe}{Graph animation}
213 \readdata{\dat}{mesdata.dat}
214
215 \begin{animateinline}[poster=last,controls]{5}%
216 \multiframe{70}{ifin=10+10}{
217 \begin{psgraph}[axesstyle=frame,xticksize=0 4cm,yticksize=0 9cm,subticks=0,Dx=100,Dy=.02](0,0)(750,.12){9cm}{4cm}
218 \listplot[xEnd=\ifin,linecolor=blue,linewidth=5pt]{\dat}
219 \end{psgraph} }%
220 \end{animateinline}
221
222 \bigskip
223 \noindent
224
225 \BS{readdata}\AC{\BS{dat}}\AC{mesdata.dat} \\
226 \BS{begin}\AC{animateinline}[poster=last,controls]\AC{5} \\
227 \BS{multiframe}\AC{70}\AC{{\red ifin}=10+10}\AC{ \\
228 \BS{begin}\AC{psgraph}[axesstyle=frame,xticksize=0 4cm,yticksize=0 9cm,subticks=0,Dx=100,Dy=.02](0,0)(750,.12)\AC{9cm}\AC{4cm} \\
229 \BS{listplot}[xEnd={\red \BS{ifin}},linecolor=blue,linewidth=5pt]\AC{\BS{dat}} \\
230 \BS{end}\AC{psgraph} } \\
231 \BS{end}\AC{animateinline}
232
233
234
235
236
237
238
239
240 %
241 %\newpage
242 %\subsection{Command options}
243 %
244 %
245 %\begin{tabular}{|c|c|} \hline
246 %poster[=first | none | last] & \\ \hline
247 %every=<num> & Build animation from every <num>th frame only \\
248 % autopause & \TFRGB{animation en pause à la fermeture de la page}{Pause animation when the page is closed } \\ \hline
249 % autoplay & Start animation after the page has opened.\\ \hline
250 % autoresume & Resume previously paused animation \\ \hline
251 % loop & The animation restarts immediately after reaching the end. \\ \hline
252 % palindrome & The animation continuously plays forwards and backwards. \\ \hline
253 % step & Step through the animation one frame at a time per mouse-click. \\ \hline
254 % width=<width> & \TFRGB{redimensionne la largeur }{Resize the width of the animation widget} \\ \hline
255 % height=<height> & \TFRGB{redimensionne la hauteur}{Resize the height of the animation widget} \\ \hline
256 % depth=<depth> & Resize the animation widget \\ \hline
257 % scale=<factor> & Scales the animation widget \\ \hline
258 % bb=<llx> <lly> <urx> <ury> & \\ \hline
259 % viewport=<llx> <lly> <urx> <ury> & \\ \hline
260 % trim=<left> <bottom> <right> <top> & \\ \hline
261 % controls & Inserts control buttons \\ \hline
262 % buttonsize=<size> & Changes the control button \\ \hline
263 % buttonbg=<colour> & strokes on transparent background \\ \hline
264 % buttonfg=<colour> & specifies the stroke colour \\ \hline
265 % draft & animation is not embedded.Instead, a box with the exact
266 % dimensions \\ \hline
267 % final & \\ \hline
268 % useocg & alternative animation method based on Optional Content Groups \\ \hline
269 % measure & Measures the frame rate during one cycle of the animation. \\ \hline
270 %\end{tabular}
271
272