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