~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to misc/m.nviz.script/m.nviz.script.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 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
 
11
tuning or editing.
 
12
 
 
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>.
 
16
 
 
17
<h2>OPTIONS</h2>
 
18
 
 
19
<h3>Flags:</h3>
 
20
<dl>
 
21
<dt><b>-i</b>
 
22
<dd>Intercative mode
 
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.
 
26
<dt><b>-f</b>
 
27
<dd>Full render
 
28
<dd>The script will draw all loaded NVIZ data and save scene to PPM image.
 
29
<dt><b>-c</b>
 
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)
 
34
<dt><b>-k</b>
 
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.
 
40
<dt><b>-o</b>
 
41
<dd>Render the animation in an off-screen context
 
42
<dt><b>-e</b>
 
43
<dd>Enable vector and sites drawing
 
44
</dl>
 
45
 
 
46
 
 
47
<h3>Parameters:</h3>
 
48
<dl>
 
49
<dt><b>input</b>
 
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.
 
52
 
 
53
<dt><b>output</b>
 
54
<dd>The name of the NVIZ script to create.
 
55
 
 
56
<dt><b>name</b>
 
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).
 
59
 
 
60
<dt><b>dist</b>
 
61
<dd>The distance of the camera behind the center of view.
 
62
 
 
63
<dt><b>ht</b>
 
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.
 
66
 
 
67
<dt><b>frames</b>
 
68
<dd>The number of frames in the animation.
 
69
 
 
70
<dt><b>start</b>
 
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
 
74
number 2000.
 
75
 
 
76
<dt><b>route</b>
 
77
<dd>The comma separated geographic coordinates for keyframe locations.
 
78
<dd>The interactive flag (<em>-i</em>) overrides this option.
 
79
 
 
80
</dl>
 
81
 
 
82
<h2>EXAMPLE</h2>
 
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:
 
86
 
 
87
<div class="code"><pre>
 
88
g.region raster=elevation.dem
 
89
d.rast elevation.dem
 
90
m.nviz.script -ik input=elevation.dem output=nviz.script dist=2400 ht=1220 frames=1000
 
91
</pre></div>
 
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
 
96
</pre></div>
 
97
 
 
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.
 
111
 
 
112
<h3>Loading the script into NVIZ</h3>
 
113
 
 
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:
 
120
 
 
121
<div class="code"><pre>
 
122
nviz state=saved.state script=nviz.script.nvscr
 
123
</pre></div>
 
124
 
 
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.
 
134
 
 
135
<h2>SEE ALSO</h2>
 
136
 
 
137
<em><a href="wxGUI.nviz.html">wxGUI 3D viewer (NVIZ)</a></em>
 
138
 
 
139
<h2>AUTHOR</h2>
 
140
 
 
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>