wxGUI.nviz.html 18 KB

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