examples/extended/visualization/movies
This example illustrates how to create a movie.
/vis/viewer/interpolate viewfiles/movie-1If you want to see an electromagnetic shower
/run/beamOn /vis/viewer/interpolate viewfiles/movie-1b. To make your own movie, save a sequence of views with
/vis/viewer/saveThen "fly through" with
/vis/viewer/interpolate".The procedure is: choose a view, save, choose another view, save, and so on until you have, say, 10 saved views. Then you may
/vis/viewer/interpolateNote: This saves views to your current working directory. It is always good to remove any pre-existing saved files:
rm *.g4viewor save them, e.g.
mkdir views mv *.g4view viewswhich can subsequently be interpolated with
/vis/viewer/interpolate viewsc. Then you have a choice of how to export the movie - see 3 below.
You can use time-slicing to see particles progress through time
a. To see a pre-prepared example
/vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns /run/beamOn /vis/viewer/interpolate viewfiles/movie-2
b. To make your own movie
/vis/scene/add/trajectories rich /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns # Optionally add features (see guidance on /vis/viewer/set/timeWindow/) /vis/viewer/set/timeWindow/displayLightFront true 0 0 -20 cm -0.01 ns /vis/viewer/set/timeWindow/displayHeadTime true /vis/viewer/set/timeWindow/fadeFactor 1 /run/beamOn # Then set a time window and save /vis/viewer/set/timeWindow/startTime 0 ns .1 ns /vis/viewer/save # Then zoom, pan etc to a view of interest # Then set the next time window and save /vis/viewer/set/timeWindow/startTime .5 ns .1 ns /vis/viewer/save # Then zoom, pan etc to a view of interest # Then set the next time window and save /vis/viewer/set/timeWindow/startTime 1 ns .1 ns /vis/viewer/save # Then another view, the next time window, and a save... # ...repeat a few more times # Then try /vis/viewer/interpolate
/vis/viewer/interpolate ! ! ! ! exportThis produces lots of files. You can change export format with (for example)
/vis/ogl/set/exportFormat jpgThen import them into your favourite movie maker - see https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#
These files are inherited from the old "novice" example N03. They draw (and optionally, save) views using a macro loop. They have not been tested recently. Best to run in batch mode in the build directory. E.g.
./movies -m visTutor/exN03Vis12.mac ./movies -m visTutor/exN03Vis13.mac
John Allison 15th February 2021