Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/visualization/movies/README.md is written in an unsupported language. File is not indexed.

0001 \page Examplemovies Example movies
0002 
0003 examples/extended/visualization/movies
0004 
0005 This example illustrates how to create a movie.
0006 
0007 See https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#.
0008 
0009 A) USING "/vis/viewer/save" AND "/vis/viewer/interpolate"
0010 =========================================================
0011 
0012 1. a. To see a pre-prepared example, start this example in interactive mode
0013       (i.e., without any command line arguments). Just type
0014 
0015             /vis/viewer/interpolate viewfiles/movie-1
0016 
0017       If you want to see an electromagnetic shower
0018 
0019             /run/beamOn
0020             /vis/viewer/interpolate viewfiles/movie-1
0021 
0022    b. To make your own movie, save a sequence of views with
0023 
0024             /vis/viewer/save
0025 
0026       Then "fly through" with
0027 
0028             /vis/viewer/interpolate".
0029 
0030       The procedure is: choose a view, save, choose another view, save, and
0031       so on until you have, say, 10 saved views. Then you may
0032 
0033             /vis/viewer/interpolate
0034 
0035       Note: This saves views to your current working directory. It is
0036       always good to remove any pre-existing saved files:
0037 
0038             rm *.g4view
0039 
0040       or save them, e.g.
0041 
0042             mkdir views
0043             mv *.g4view views
0044 
0045       which can subsequently be interpolated with
0046 
0047             /vis/viewer/interpolate views
0048 
0049    c. Then you have a choice of how to export the movie - see 3 below.
0050 
0051 2. You can use time-slicing to see particles progress through time
0052 
0053    a. To see a pre-prepared example
0054 
0055          /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
0056          /run/beamOn
0057          /vis/viewer/interpolate viewfiles/movie-2
0058 
0059    b. To make your own movie
0060 
0061          /vis/scene/add/trajectories rich
0062          /vis/modeling/trajectories/drawByCharge-0/default/setTimeSliceInterval 0.01 ns
0063          # Optionally add features (see guidance on /vis/viewer/set/timeWindow/)
0064          /vis/viewer/set/timeWindow/displayLightFront true 0 0 -20 cm -0.01 ns
0065          /vis/viewer/set/timeWindow/displayHeadTime true
0066          /vis/viewer/set/timeWindow/fadeFactor 1
0067          /run/beamOn
0068          # Then set a time window and save
0069          /vis/viewer/set/timeWindow/startTime 0 ns .1 ns
0070          /vis/viewer/save
0071          # Then zoom, pan etc to a view of interest
0072          # Then set the next time window and save
0073          /vis/viewer/set/timeWindow/startTime .5 ns .1 ns
0074          /vis/viewer/save
0075          # Then zoom, pan etc to a view of interest
0076          # Then set the next time window and save
0077          /vis/viewer/set/timeWindow/startTime 1 ns .1 ns
0078          /vis/viewer/save
0079          # Then another view, the next time window, and a save...
0080          # ...repeat a few more times
0081          # Then try
0082          /vis/viewer/interpolate
0083 
0084 3. How to export images using /vis/viewer/interpolate (OpenGL only)
0085 
0086          /vis/viewer/interpolate ! ! ! ! export
0087 
0088    This produces lots of files.
0089    You can change export format with (for example)
0090 
0091          /vis/ogl/set/exportFormat jpg
0092 
0093    Then import them into your favourite movie maker - see
0094    https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/makingamovie.html#
0095 
0096 B) THE OLD WAY
0097 ==============
0098 
0099 These files are inherited from the old "novice" example N03. They draw (and
0100 optionally, save) views using a macro loop. They have not been tested
0101 recently. Best to run in batch mode in the build directory. E.g.
0102 
0103     ./movies -m visTutor/exN03Vis12.mac
0104     ./movies -m visTutor/exN03Vis13.mac
0105 
0106 
0107 John Allison
0108 15th February 2021