source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/Visualization/makingamovie.xml @ 904

Last change on this file since 904 was 904, checked in by garnier, 16 years ago

ajout de la doc

File size: 7.8 KB
Line 
1<!-- ******************************************************** -->
2<!--                                                          -->
3<!--  [History]                                               -->
4<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
5<!--                                                          -->
6<!-- ******************************************************** -->
7
8
9<!-- ******************* Section (Level#1) ****************** -->
10<sect1 id="sect.MkMovie">
11<title>
12Making a Movie
13</title>
14
15<para>
16These instructions are suggestive only. The following procedures
17have not been tested on all platforms. There are clearly some
18instructions that apply only to Unix-like systems with an X-Windows
19based windowing system. However, it should not be difficult to take
20the ideas presented here and extend them to other platforms and
21systems.
22</para>
23
24<para>
25The procedures described here need graphics drivers that
26can produce picture files that can be converted to a form suitable
27for an MPEG encoder. There may be other ways of capturing the
28screen images and we would be happy to hear about them. Graphics
29drivers currently capable of producing picture files are:
30
31<informaltable>
32  <tgroup cols="2">
33    <tbody>
34    <row>
35      <entry>
36        <emphasis role="bold">Driver</emphasis>
37      </entry>
38      <entry>
39        <emphasis role="bold">File type</emphasis>
40      </entry>
41    </row>
42    <row>
43      <entry>
44        DAWNFILE
45      </entry>
46      <entry>
47        prim then eps using <emphasis role="bold">dawn</emphasis>
48      </entry>
49    </row>
50    <row>
51      <entry>
52        HepRepFile
53      </entry>
54      <entry>
55        HepRep1
56      </entry>
57    </row>
58    <row>
59      <entry>
60        HepRep
61      </entry>
62      <entry>
63        HepRep2
64      </entry>
65    </row>
66    <row>
67      <entry>
68        OGLX
69      </entry>
70      <entry>
71        eps
72      </entry>
73    </row>
74    <row>
75      <entry>
76        RayTracer
77      </entry>
78      <entry>
79        jpeg
80      </entry>
81    </row>
82    <row>
83      <entry>
84        VRMLFILE
85      </entry>
86      <entry>
87        vrml
88      </entry>
89    </row>
90    </tbody>
91  </tgroup>
92</informaltable>
93</para>
94
95<para>
96So far, only DAWNFILE, OGLX and RayTracer have been "road tested".
97Once in a standard format, such as eps, the
98<emphasis role="bold">convert</emphasis> program from
99<ulink url="http://www.imagemagick.org">
100ImageMagick
101</ulink>
102 can convert to ppm files suitable for
103<emphasis role="bold">mpeg2encode</emphasis>.
104</para>
105
106
107<!-- ******************* Section (Level#2) ****************** -->
108<sect2 id="sect.MkMovie.OGLX">
109<title>
110OGLX
111</title>
112
113<para>
114Make a macro something like this:
115
116<informalexample>
117<programlisting>
118/control/verbose 2
119/vis/open OGLSX 600x600-0+0
120/vis/drawVolume
121/vis/viewer/reset
122/vis/viewer/set/style surface
123/vis/viewer/set/projection perspective 50 deg
124/control/alias phi 30
125/control/loop movie.loop theta 0 360 1
126</programlisting>
127</informalexample>
128
129which invokes movie.loop, which is something like:
130
131<informalexample>
132<programlisting>
133/vis/viewer/set/viewpointThetaPhi {theta} {phi}
134/vis/viewer/zoom 1.005
135/vis/ogl/printEPS
136</programlisting>
137</informalexample>
138</para>
139
140<para>
141This produces lots of eps files. Then...
142
143<informalexample>
144<programlisting>
145<ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> G4OpenGL_*eps
146</programlisting>
147</informalexample>
148</para>
149
150<para>
151Then edit mpeg2encode.par to specify file type and size, etc.:
152
153<informalexample>
154<programlisting>
155$ diff mpeg2encode.par~ mpeg2encode.par
1567c7
157&lt; 1         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
158---
159&gt; 2         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
16015,17c15,17
161&lt;    /* horizontal_size */
162&lt;   /* vertical_size */
163&lt; 8         /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */
164---
165&gt; 600   /* horizontal_size */
166&gt; 600  /* vertical_size */
167&gt; 1         /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */
168</programlisting>
169</informalexample>
170</para>
171
172<para>
173Then convert to ppm:
174
175<informalexample>
176<programlisting>
177for i in G4OpenGL*eps;
178  do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; done
179</programlisting>
180</informalexample>
181</para>
182
183<para>
184Then
185
186<informalexample>
187<programlisting>
188mpeg2encode mpeg2encode.par G4OpenGL.mpg
189</programlisting>
190</informalexample>
191</para>
192
193<para>
194Then, on Mac, for example:
195
196<informalexample>
197<programlisting>
198open G4OpenGL.mpg
199</programlisting>
200</informalexample>
201
202opens a QuickTime player.
203</para>
204
205</sect2>
206
207
208<!-- ******************* Section (Level#2) ****************** -->
209<sect2 id="sect.MkMovie.DAWNFILE">
210<title>
211DAWNFILE
212</title>
213
214<para>
215You need to invoke <emphasis role="bold">dawn</emphasis> in "direct" mode,
216which picks up parameters from .DAWN_1.history, and suppress the GUI:
217
218<informalexample>
219<programlisting>
220alias dawn='dawn -d'
221export DAWN_BATCH=1
222</programlisting>
223</informalexample>
224</para>
225
226<para>
227Change OGLSX to DAWNFILE in the above set of Geant4 commands and
228run. Then convert to ppm files as above:
229
230<informalexample>
231<programlisting>
232for i in g4_*.eps;
233  do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; done
234</programlisting>
235</informalexample>
236</para>
237
238<para>
239Then make a .par file:
240
241<informalexample>
242<programlisting>
243<ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> g4_*ppm
244</programlisting>
245</informalexample>
246
247and edit mpeg2encode.par:
248
249<informalexample>
250<programlisting>
251$ diff mpeg2encode.par~ mpeg2encode.par
2527c7
253&lt; 1         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
254---
255&gt; 2         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
2569c9
257&lt; 1         /* number of first frame */
258---
259&gt; 0         /* number of first frame */
26015,16c15,16
261&lt;    /* horizontal_size */
262&lt;   /* vertical_size */
263---
264&gt; 482   /* horizontal_size */
265&gt; 730  /* vertical_size */
266</programlisting>
267</informalexample>
268</para>
269
270<para>
271Then encode and play:
272
273<informalexample>
274<programlisting>
275mpeg2encode mpeg2encode.par DAWN.mpg
276open DAWN.mpg
277</programlisting>
278</informalexample>
279</para>
280
281</sect2>
282
283
284<!-- ******************* Section (Level#2) ****************** -->
285<sect2 id="sect.MkMovie.RyTrcX">
286<title>
287RayTracerX
288</title>
289
290<para>
291<informalexample>
292<programlisting>
293/control/verbose 2
294/vis/open RayTracerX 600x600-0+0
295# (Raytracer doesn't need a scene; smoother not to /vis/drawVolume.)
296/vis/viewer/reset
297/vis/viewer/set/style surface
298/vis/viewer/set/projection perspective 50 deg
299/control/alias phi 30
300/control/loop movie.loop theta 0 360 1
301</programlisting>
302</informalexample>
303
304where movie.loop is as above. This produces lots of jpeg files (but
305takes 3 days!!!). Then...
306
307<informalexample>
308<programlisting>
309<ulink url="./make_mpeg2encode_parfile.sh">make_mpeg2encode_parfile.sh</ulink> g4RayTracer*jpeg
310</programlisting>
311</informalexample>
312</para>
313
314<para>
315Then edit mpeg2encode.par to specify file type and size, etc.:
316
317<informalexample>
318<programlisting>
319$ diff mpeg2encode.par.orig mpeg2encode.par     
3207c7
321&lt; 1         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
322---
323&gt; 2         /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */
32415,17c15,17
325&lt;    /* horizontal_size */
326&lt;   /* vertical_size */
327&lt; 8         /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */
328---
329&gt; 600   /* horizontal_size */
330&gt; 600  /* vertical_size */
331&gt; 1         /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */
332</programlisting>
333</informalexample>
334</para>
335
336<para>
337
338Then convert to ppm, encode and play:
339
340<informalexample>
341<programlisting>
342for i in g4*jpeg;
343  do j=`basename $i .jpeg`; command="convert $i $j.ppm"; echo $command; $command; done
344mpeg2encode mpeg2encode.par g4RayTracer.mpg
345open g4RayTracer.mpg
346</programlisting>
347</informalexample>
348</para>
349
350
351</sect2>
352</sect1>
Note: See TracBrowser for help on using the repository browser.