1
<!-- meta page description: wxGUI 3D View Mode -->
2
<!-- meta page index: wxGUI -->
5
Note: <b>wxNviz is currently under development. Not
6
all planned functionality is already implemented.</b>
9
<b>wxNviz</b> is a <em><a href="wxGUI.html">wxGUI</a></em> <b>3D view
10
mode</b> which allows users to realistically render multiple
11
<em>surfaces</em> (2D raster maps) in a 3D space, optionally using
12
thematic coloring, draping 2D <em>vector</em> data or different 2D raster data
13
over the surfaces, displaying 3D vector data in the space, and visualization
14
of <em>3D rasters</em>.
17
To start the wxGUI 3D view mode, choose '3D view' from the map
18
toolbar. You can switch between 2D and 3D view. The region in
19
3D view is updated according to displayed region in 2D view.
21
wxNviz is emphasized on the ease and speed of viewer positioning and
22
provided flexibility for using a wide range of data. A low resolution
23
surface or wire grid (optional) provides real-time viewer positioning
24
capabilities. Coarse and fine resolution controls allow the user to
25
further refine drawing speed and detail as needed. Continuous scaling
26
of elevation provides the ability to use various data types for the
30
For each session of wxNviz, you might want the same set of 2D/3D
31
raster and vector data, view parameters, or other attributes. For
32
consistency between sessions, you can store this information in the
33
GRASS <em>workspace</em> file (gxw). Workspace contains information to
34
restore "state" of the system in 2D and if wxNviz is enabled also in
37
<h2>3D View Toolbar</h2>
40
<br><img src="wxGUI_nviz_toolbar.jpg" border="1" alt="toolbar"><br><br>
44
<dt><img src="icons/script-save.png" alt="icon">
45
<em>Generate command for m.nviz.image</em></dt>
46
<dd>Generate command for m.nviz.image based on current state.</dd>
47
<dt><img src="icons/settings.png" alt="icon">
48
<em>Show 3D view mode settings</em></dt>
49
<dd>Show dialog with settings for wxGUI 3D view mode. The user
50
settings can be stored in wxGUI settings file.</dd>
51
<dt><img src="icons/help.png" alt="icon">
52
<em>Show help</em></dt>
53
<dd>Show this help.</dd>
56
<h2>3D View Layer Manager Toolbox</h2>
58
The 3D view toolbox is integrated in the Layer Manager. The toolbox
62
<li><b>View</b> for view controlling,</li>
63
<li><b>Data</b> for data properties,</li>
64
<li><b>Appearance</b> for appearance settings (lighting, fringes, ...).</li>
65
<li><b>Analysis</b> for various data analyses (only cutting planes so far).</li>
66
<li><b>Animation</b> for creating simple animations.</li>
71
You can use this panel to set the <em>position, direction, and
72
perspective</em> of the view. The position box shows a puck with a
73
direction line pointing to the center. The direction line indicates
74
the look direction (azimuth). You click and drag the puck to change
75
the current eye position. Another way to change eye position is
76
to press the buttons around the position box representing cardinal
77
and ordinal directions.
80
There are four other buttons for view control in the bottom of this panel
81
(following label <em>Look:</em>):
83
<li><em>here</em> requires you to click on Map Display Window to determine
84
the point to look at.</li>
85
<li><em>center</em> changes the point you are looking at to the center.</li>
86
<li><em>top</em> moves the current eye position above the map center.</li>
87
<li><em>reset</em> returns all current view settings to their default values.</li>
91
<br><img src="wxGUI_nviz_tools_view.jpg" border="1" alt="toolbox"><br><br>
94
You can adjust the viewer's height above the scene, perspective and
95
twist value to rotate the scene about the horizontal axis. An angle of
96
0 is flat. The scene rotates between -90 and 90 degrees.
99
You can also adjusts the vertical exaggeration of the surface. As an
100
example, if the easting and northing are in meters and the elevation
101
in feet, a vertical exaggeration of 0.305 would produce a true
102
(unexaggerated) surface.
104
View parameters can be controlled by sliders or edited directly in the
105
text boxes. It is possible to enter values which are out of slider's range
106
(and it will then adjust to the new range).
108
<h4>Fly-through mode</h4>
110
View can be changed in fly-through mode (can be activated in Map Display
111
toolbar), which enables to change the view smoothly and therefore it is
112
suitable for creating animation (see below). To start flying, press left
113
mouse button and hold it down to continue flying. Flight direction is
114
controlled by mouse cursor position on screen. Flight speed can be
115
increased/decreased stepwise by keys PageUp/PageDown, Home/End or Up/Down
116
arrows. Speed is increased multiple times while Shift key is held down.
117
Holding down Ctrl key switches flight mode in the way that position of
118
viewpoint is changed (not the direction).
120
<h3>Data properties</h3>
121
This tab controls the parameters related to map layers. It consists
122
of four collapsible panels - <em>Surface</em>, <em>Constant surface</em>,
123
<em>Vector</em> and <em>3D raster</em>.
127
Each active raster map layer from the current layer tree is displayed as
128
surface in the 3D space. This panel controls how loaded surfaces are
129
drawn. To change parameters of a surface, it must be selected in the very
130
top part of the panel.
132
The top half of the panel has drawing style options.
133
Surface can be drawn as a wire mesh or using filled polygons (most
134
realistic). You can set draw <b>mode</b> to <em>coarse</em> (fast
135
display mode), <em>fine</em> (draws surface as filled polygons with
136
fine resolution) or <em>both</em> (which combines coarse and fine
137
mode). Additionally set coarse <b>style</b> to <em>wire</em> to draw
138
the surface as wire mesh (you can also choose color of the wire)
139
or <em>surface</em> to draw the surface using coarse resolution filled
140
polygons. This is a low resolution version of the polygon surface
143
E.g. surface is drawn as a wire mesh if you set <b>mode</b>
144
to <em>coarse</em> and <b>style</b> to <em>wire</em>. Note that it
145
differs from the mesh drawn in fast display mode because hidden lines
146
are not drawn. To draw the surface using filled polygons, but with
147
wire mesh draped over it, choose <b>mode</b> <em>both</em>
148
and <b>style</b> <em>wire</em>.
150
Beside mode and style you can also choose style of <b>shading</b> used
151
for the surface. <em>Gouraud</em> style draws the surfaces with a
152
smooth shading to blend individual cell colors together, <em>flat</em>
153
draws the surfaces with flat shading with one color for every two
154
cells. The surface appears faceted.
157
To set given draw settings for all loaded surfaces press button "Set to
161
The bottom half of the panel has options to set, unset or modify
162
attributes of the current surface. Separate raster data or constants can
163
be used for various attributes of the surface:
165
<li><b>color</b> - raster map or constant color to drape over the current
166
surface. This option is useful for draping imagery such as aerial
167
photography over a DEM.</li>
168
<li><b>mask</b> - raster map that controls the areas displayed from
169
the current surface.</li>
170
<li><b>transparency</b> - raster map or constant value that controls
171
the transparency of the current surface. The default is completely
172
opaque. Range from 0 (opaque) to 100 (transparent).</li>
173
<li><b>shininess</b> - raster map or constant value that controls
174
the shininess (reflectivity) of the current surface. Range from 0 to
179
In the very bottom part of the panel position of surface can be set.
180
To move the surface right (looking from the south) choose <em>X</em> axis
181
and set some positive value. To reset the surface position press
182
<em>Reset</em> button.
185
<br><img src="wxGUI_nviz_tools_surface.jpg" border="1" alt="toolbox"><br><br>
188
<h4>Constant surface</h4>
189
It is possible to add constant surface and set its properties like
190
fine resolution, value (height), color and transparency. It behaves
191
similarly to surface but it has less options.
195
2D vector data can be draped on the selected surfaces with various
196
markers to represent point data; you can use attribute of vector
197
features to determine size, color, shape of glyph.
199
3D vector data including volumes (closed group of faces with one
200
kernel inside) is also supported.
201
This panel controls how loaded 2D or 3D vector data are drawn.
204
You can define the width (in pixels) of the line features, the color
205
used for lines or point markers.
208
If vector map is 2D you can display vector features as flat at a
209
specified elevation or drape it over a surface(s) at a specified
210
height. Use the height control to set the flat elevation or the drape
211
height above the surface(s). In case of multiple surfaces it is possible
212
to specify which surfaces is the vector map draped over.
215
For display purposes, it is better to set the height slightly above
216
the surface. If the height is set at zero, portions of the vector may
217
disappear into the surface(s).
220
For 2D/3D vector points you can also set the size of the markers.
221
<!-- and the width (in pixels) of the line used to draw the point markers (only
222
applies to wire-frame markers). -->
223
Currently are implemented these markers:
226
<li><b>x</b> sets the current points markers to a 2D "X",</li>
227
<li><b>sphere</b> - solid 3D sphere,</li>
228
<li><b>diamond</b> - solid 3D diamond,</li>
229
<li><b>cube</b> - solid 3D cube,</li>
230
<li><b>box</b> - hollow 3D cube,</li>
231
<li><b>gyroscope</b> - hollow 3D sphere,</li>
232
<li><b>asterisk</b> - 3D line-star.</li>
236
Thematic mapping can be used to determine marker color and size
237
(and line color and width).
240
<br><img src="wxGUI_nviz_tools_vector.jpg" border="1" alt="toolbox"><br><br>
245
3D raster maps (volumes, voxel models) can be displayed either as isosurfaces
247
Similarly to surface panel you can define draw <b>shading</b> -
248
<em>gouraud</em> (draws the 3D rasters with a smooth shading to blend
249
individual cell colors together) and <em>flat</em> (draws the 3D rasters with
250
flat shading with one color for every two cells. The 3D raster appears
251
faceted). As mentioned above currently are supported two visualization
255
<li><b>isosurface</b> - the levels of values for drawing the
256
3D raster(s) as isosurfaces,</li>
257
<li>and <b>slice</b> - drawing the 3D raster
258
as cross-sections.</li>
261
The middle part of the panel has controls to add, delete, move up/down
262
selected isosurface or slice. The bottom part differs for isosurface and
263
slice. When choosing an isosurface, this part the of panel has options to
264
set, unset or modify attributes of the current isosurface. Various
265
attributes of the isosurface can be defined, similarly to surface
269
<li><b>isosurface value</b> - reference isosurface value (height in map
271
<li><b>color</b> - raster map or constant color to drape over the
272
current 3D raster.</li>
273
<li><b>mask</b> - raster map that controls the areas displayed from
274
the current 3D raster.</li>
275
<li><b>transparency</b> - raster map or constant value that controls
276
the transparency of the current 3D raster. The default is completely
277
opaque. Range from 0 (opaque) to 100 (transparent).</li>
278
<li><b>shininess</b> - raster map or constant value that controls
279
the shininess (reflectivity) of the current 3D raster. Range from 0 to
283
In case of 3D raster slice the bottom part of the panel controls the slice
284
attributes (which axis is slice parallel to, position of slice edges,
285
transparency). Press button <em>Reset</em> to reset slice position
288
3D rasters can be moved the same way like surfaces do.
291
<br><img src="wxGUI_nviz_tools_volume.jpg" border="1" alt="toolbox"><br><br>
295
<em>Analysis</em> tab contains <em>Cutting planes</em> panel.
297
<h4>Cutting planes</h4>
299
Cutting planes allow to cut surfaces along a plane. You can switch
300
between six planes; to disable cutting planes switch to <em>None</em>.
301
Initially the plane is vertical, you can change it to horizontal by
302
setting <em>tilt</em> 90 degrees. The <em>X</em> and <em>Y</em> values
303
specify the rotation center of plane. You can see better what <em>X</em>
304
and <em>Y</em> do when changing <em>rotation</em>. The <em>Height</em>
305
parameter applies only when changing <em>tilt</em> concurrently.
306
Press the <em>Reset</em> button to reset the current cutting plane.
308
In case of multiple surfaces you can visualize the cutting plane by
309
<em>Shading</em>. Shading is visible only when more than one surface
310
is loaded and these surfaces must have the same fine resolution set.
314
Appearance tab consists of three collapsible panels:
317
<li><em>Lighting</em> for adjusting light source</li>
318
<li><em>Fringe</em> for drawing fringes
319
<li><em>Decorations</em> to display north arrow and scale bar</li>
322
The <em>lighting</em> panel enables to change the position of light
323
source, light color, brightness and ambient. Light position is controlled
324
similarly to eye position. If option <em>Show light model</em> is enabled
325
light model is displayed to visualize the light settings.
328
<br><img src="wxGUI_nviz_tools_light.jpg" border="1" alt="toolbox"><br><br>
331
The <em>Fringe</em> panel allows you to draw fringes in different
332
directions (North & East, South & East, South & West, North
333
& West). It is possible to set the fringe color and height of the
336
The <em>Decorations</em> panel enables to display north arrow and simple
337
scale bar. North arrow and scale bar length is determined in map units.
338
You can display more than one scale bar.
341
Animation panel enables to create a simple animation as a sequence of
342
images. Press 'Record' button and start changing the view. Views are
343
recorded in given interval (FPS - Frames Per Second). After recording, the
344
animation can be replayed. To save the animation, fill in the directory
345
and file prefix, choose image format (PPM or TIF) and then press 'Save'.
346
Now wait until the last image is generated.
348
It is recommended to record animations using fly-through mode to achieve
353
This panel has controls which allows user to set default surface,
354
vector and 3D raster data attributes. You can also modify default view
355
parameters, or to set the background color of the Map Display Window
356
(the default color is white).
359
<h2>To be implemented</h2>
362
<li>Labels, decoration, etc. (Implemented, but not fully functional)</li>
363
<li>Surface - mask by zero/elevation, more interactive positioning</li>
364
<li>Vector points - implement display mode flat/surface for 2D points</li>
370
wxNviz is under active development and
371
distributed as "Experimental Prototype".
374
Please note that with wxGTK port of wxPython (Linux systems), a problem
375
might appear during wxNviz initialization (nothing is rendered at all) or
376
when rendering vectors (bad order of rendering surfaces and vectors). If
377
you encounter such problems, try to change a depth buffer number in
378
<i>wxGUI Settings > Preferences > Map Display > Advanced</i>
379
(possible numbers are 0, 16, 24, 32). It is currently not possible to
380
automatically determine the right number which is working for your
387
<a href="wxGUI.html">wxGUI</a><br>
388
<a href="wxGUI.components.html">wxGUI components</a>
392
See also <a href="http://grasswiki.osgeo.org/wiki/WxNVIZ">wiki</a> page
393
(especially various <a href="http://grasswiki.osgeo.org/wiki/WxNVIZ#Video_tutorials">video
398
Command-line module <em><a href="m.nviz.image.html">m.nviz.image</a></em>.
404
<b>The wxNviz GUI</b>
406
<a href="http://geo.fsv.cvut.cz/gwiki/Landa">Martin
407
Landa</a>, <a href="http://grasswiki.osgeo.org/wiki/WxNviz_GSoC_2008">Google
408
Summer of Code 2008</a> (mentor: Michael Barton)
409
and <a href="http://grasswiki.osgeo.org/wiki/WxNviz_GSoC_2010">2010</a> (mentor: Helena Mitasova)<br>
410
Anna Kratochvilova, <a href="http://grasswiki.osgeo.org/wiki/WxNviz_GSoC_2011">Google
411
Summer of Code 2011</a> (mentor: Martin Landa)
414
<b>The OGSF library and NVIZ engine</b>
417
NVIZ (GRASS's <i>n</i>-dimensional visualization suite) was written
418
by Bill Brown, Terry Baker, Mark Astley, and David Gerdes,
419
U.S. Army Corps of Engineers Research Laboratories, Champaign,
420
Illinois and UI GMS Laboratory, Urbana, IL in the early 1990s.
422
Original documentation was written by Terry Baker (spring 1995), and
423
updated by Mark Astley, based on a document written by Bill Brown.
424
Additional design help and funding in the early 1990s by Helena
425
Mitasova (CERL). Tcl/Tk support added by Terry Baker. Ported to Linux
426
by Jaro Hofierka and others. Conversion from SGI IRIS GL code to
427
OpenGL by Justin Hickey. Further program and documentation (2004)
428
updates by Bob Covill, Tekmap Consulting. 3D volume support by Tomas
429
Paudits with supervision from Jaro Hofierka and Helena Mitasova.
430
Fly-through mode, thematic site attributes, and picking by Massimo
431
Cuomo (ACS) with updates by Michael Barton. GRASS 6 vector support by
432
Radim Blazek. Additional updates by Markus Neteler, Martin Landa,
433
Glynn Clements, and Hamish Bowman.
436
NVIZ evolved from the earlier GRASS program <em>SG3d</em> written
437
for Silicon Graphics IRIS GL by Bill Brown and Dave Gerdes at USA
438
CERL, 1990-1995 and from the NVIZ Motif version written by Bill Brown
439
with contributions by Terrance McGhee.
443
<i>$Date: 2015-01-14 06:51:21 +0100 (Wed, 14 Jan 2015) $</i>