Geant4 User's Guide For Application Developers Visualization |
Driver | File type |
DAWNFILE | prim then eps using dawn |
HepRepFile | HepRep1 |
HepRep | HepRep2 |
OGLX | eps |
RayTracer | jpeg |
VRMLFILE | vrml |
/control/verbose 2 /vis/open OGLSX 600x600-0+0 /vis/drawVolume /vis/viewer/reset /vis/viewer/set/style surface /vis/viewer/set/projection perspective 50 deg /control/alias phi 30 /control/loop movie.loop theta 0 360 1which invokes movie.loop, which is something like:
/vis/viewer/set/viewpointThetaPhi {theta} {phi} /vis/viewer/zoom 1.005 /vis/oglx/printEPSThis produces lots of eps files. Then...
make_mpeg2encode_parfile.sh G4OpenGL_*epsThen edit mpeg2encode.par to specify file type and size, etc.:
$ diff mpeg2encode.par~ mpeg2encode.par 7c7 < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ --- > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ 15,17c15,17 < /* horizontal_size */ < /* vertical_size */ < 8 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ --- > 600 /* horizontal_size */ > 600 /* vertical_size */ > 1 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */Then convert to ppm:
for i in G4OpenGL*eps; do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; doneThen
mpeg2encode mpeg2encode.par G4OpenGL.mpgThen, on Mac, for example:
open G4OpenGL.mpgopens a QuickTime player.
alias dawn='dawn -d' export DAWN_BATCH=1Change OGLSX to DAWNFILE in the above set of Geant4 commands and run. Then convert to ppm files as above:
for i in g4_*.eps; do j=`basename $i .eps`; command="convert $i $j.ppm"; echo $command; $command; doneThen make a .par file:
make_mpeg2encode_parfile.sh g4_*ppmand edit mpeg2encode.par:
$ diff mpeg2encode.par~ mpeg2encode.par 7c7 < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ --- > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ 9c9 < 1 /* number of first frame */ --- > 0 /* number of first frame */ 15,16c15,16 < /* horizontal_size */ < /* vertical_size */ --- > 482 /* horizontal_size */ > 730 /* vertical_size */Then encode and play:
mpeg2encode mpeg2encode.par DAWN.mpg open DAWN.mpg
/control/verbose 2 /vis/open RayTracerX 600x600-0+0 # (Raytracer doesn't need a scene; smoother not to /vis/drawVolume.) /vis/viewer/reset /vis/viewer/set/style surface /vis/viewer/set/projection perspective 50 deg /control/alias phi 30 /control/loop movie.loop theta 0 360 1where movie.loop is as above. This produces lots of jpeg files (but takes 3 days!!!). Then...
make_mpeg2encode_parfile.sh g4RayTracer*jpegThen edit mpeg2encode.par to specify file type and size, etc.:
$ diff mpeg2encode.par.orig mpeg2encode.par 7c7 < 1 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ --- > 2 /* input picture file format: 0=*.Y,*.U,*.V, 1=*.yuv, 2=*.ppm */ 15,17c15,17 < /* horizontal_size */ < /* vertical_size */ < 8 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */ --- > 600 /* horizontal_size */ > 600 /* vertical_size */ > 1 /* aspect_ratio_information 1=square pel, 2=4:3, 3=16:9, 4=2.11:1 */Then convert to ppm, encode and play:
for i in g4*jpeg; do j=`basename $i .jpeg`; command="convert $i $j.ppm"; echo $command; $command; done mpeg2encode mpeg2encode.par g4RayTracer.mpg open g4RayTracer.mpg