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