3
The <em>m.nviz.script</em> program allows the user to easily create a script
4
that can be run in NVIZ to fly through a terrain.
6
The NVIZ flight path can be chosen interactively from the GRASS
7
monitor (<em>-i</em>) or supplied on the command line as comma
8
separated coordinates. The program optionally allows a KeyFrame
9
file to created (after running the script). This KeyFrame file can
10
be loaded into the <em>Keyframe Animation</em> panel for fine
13
<p>The script generated by <em>m.nviz.script</em> can be run from the NVIZ
14
command line (nviz script=script_name) or after NVIZ is started by
15
selecting <em>Scripting->Play Script</em>.
23
<dd>The user selects the camera path from the GRASS monitor by
24
clicking the left mouse button along the route. Click the
25
right mouse button to finish.
28
<dd>The script will draw all loaded NVIZ data and save scene to PPM image.
30
<dd>Flay at constant elevation
31
<dd>With this flag the camera will be set to an elevation given by the
32
<em>ht=</em> parameter. The default is to fly at <em>ht=</em>
33
above the topography (i.e. camera height = elevation + ht)
35
<dd>Output KeyFrame file
36
<dd>Generate a KeyFrame file that can be loaded from the NVIZ
37
<em>Keyframe Animation</em> panel. The KeyFrame file is
38
automatically assigned the script name with a
39
<em>.kanimator</em> extension.
41
<dd>Render the animation in an off-screen context
43
<dd>Enable vector and sites drawing
50
<dd>The name of the GRASS raster map with elevation data.
51
<dd>This should be the same file that will be loaded in NVIZ.
54
<dd>The name of the NVIZ script to create.
57
<dd>The prefix for output images if running in full render mode (<em>-f</em>).
58
<dd>The defulat preifix is NVIZ (eg. NVIZ0000.ppm).
61
<dd>The distance of the camera behind the center of view.
64
<dd>The height of the camera above the center of view.
65
<dd>If the the <em>-c</em> flag is set, the height represents the actual camera height.
68
<dd>The number of frames in the animation.
71
<dd>The starting frame number (default = 0).
72
<dd> This option may be useful in full render mode when creating an
73
animation in sections. For example the user may wish to start at frame
77
<dd>The comma separated geographic coordinates for keyframe locations.
78
<dd>The interactive flag (<em>-i</em>) overrides this option.
83
To interactively create an NVIZ animation from raster elev.rast with
84
500 frames and the camera set to 50 meters above and 250 meters behind
85
the scene, run the following:
87
<div class="code"><pre>
88
g.region raster=elevation.dem
90
m.nviz.script -ik input=elevation.dem output=nviz.script dist=2400 ht=1220 frames=1000
92
In the above the example the user is prompted to select the route from the GRASS monitor.
93
The output script, 'nviz.script.nvscr', can then be run in NVIZ:
94
<div class="code"><pre>
95
nviz elevation=elevation.dem script=nviz.script.nvscr
98
<h2>NOTES / HINTS</h2>
99
The user must select at least four key-frame locations (points)
100
otherwise an error is generated.
101
<p>If the GRASS region is changed the <em>m.nviz.script</em> command must be re-run.
102
<p>The current GRASS region and the user supplied parameters are included
103
as a comment at the top of the output script. This information can be
104
used to easily re-create the animation.
105
<p>The camera position is calculated backwards from the supplied
106
position(s). It is possible that the camera position will lie outside
107
the current window, in which case a non-fatal error is generated
108
(Error: selected point is outside region). This error can result in
109
jerky movements during the animation. To correct this problem reduce
110
the <em>dist=</em> parameter or increase the current region.
112
<h3>Loading the script into NVIZ</h3>
114
The user can run the script at arbitrary resolution. To re-run it at
115
higher spatial resolution or different settings, the user first loads
116
the surface and sets the resolution, lighting, etc. Then internally
117
the script generated by <em>m.nviz.script</em> is run. Alternatively, the
118
user can run nviz with a previuosly saved state and the
119
<em>m.nviz.script</em> generated script:
121
<div class="code"><pre>
122
nviz state=saved.state script=nviz.script.nvscr
125
<h3>Keyframe animator script</h3>
126
Running the script generated by <em>m.nviz.script</em> within NVIZ, a new script for
127
kanimator (keyframe animator) is created. The kanimator panel offers
128
fine tuning of the speed (frame rate) as well as editing individual
129
frames or inserting new frames. This new kanimator script has to be
130
loaded from the Kanimator panel in NVIZ. In the Kanimator panel there
131
are Save and Load button which allow the user to save and re-load a
132
kanimator script. Once loaded, the key frames will appear in the GUI
133
and can then be edited there.
137
<em><a href="wxGUI.nviz.html">wxGUI 3D viewer (NVIZ)</a></em>
141
<a href="mailto:bcovill@tekmap.ns.ca">Bob Covill</a>
142
<p><i>Last changed: $Date: 2014-12-19 22:55:37 +0100 (Fri, 19 Dec 2014) $</i>