WxNviz: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
m (remove hardcoded version specific urls, use latest version)
 
(65 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__TOC__
''(Back to [[WxPython-based GUI for GRASS|wxGUI]] page.)''


Back to [[WxPython-based GUI for GRASS|wxGUI]] page.
'''wxNviz''' is a [[wxGUI]] extension which allows users to realistically render multiple surfaces (raster data) in a 3D space, optionally using thematic coloring, draping 2D vector data over the surfaces, displaying 3D vector data in the space, and visualization of volume data (3D raster data).  


[http://trac.osgeo.org/grass/wiki/SoCProjects#a3.53DvisualizationtoolforwxPythonGRASSGUI Accepted Google Summer of Code 2008 project]
For usage instructions, see also the {{cmd|wxGUI.nviz|desc=manual page}}.


* http://lists.osgeo.org/pipermail/grass-dev/2008-February/035792.html
__TOC__
== Screenshots ==
<center>
<gallery perrow=3 widths=200>
Image:Wxnviz-alpha-0.png|2008-06-27: Display raster map from layer tree in 2.5D (surface)
Image:Wxnviz-alpha-1.png|2008-07-05: Support for vector data (2D lines) added
Image:Wxnviz-alpha-2.png|2008-07-26: Support for vector point data
Image:Wxnviz-alpha-3.png|2008-08-02: 3D vector data support
Image:Wxnviz-alpha-4.png|2008-08-09: Initial support for volumetric data
Image:Wxnviz-lmgr.png|2010-05-31: 3D view tools window integrated into Layer Manager
Image:Wxnviz-light.png|Lighting control panel in Layer Manager (2010-06-17)
Image:Wxnviz-fringe.png|Fringe control panel in Layer Manager (2010-06-23)
Image:Wxnviz-redirect.png|Redirect messages to wxGUI (2010-08-08)
Image:Wxnviz-volumes.png|Displaying raster (surface), 2D vector and 3D raster (volume) in the 3D space (2010-08-16)
Image:WxNviz surface page.png|Surface page of WxNviz modified (2011-06-02)
Image:WxNviz_constant_surface_page.png|Constant surface page added (2011-06-02)
Image:WxNviz_lighting.png|Lighting fixed (2011-05-02)
Image:WxNviz_cutting_planes_1.png|Cutting planes (shading blend) (2011-06-10)
Image:WxNviz_cutting_planes_2.png|Cutting planes (shading top color) (2011-06-10)
Image:WxNviz_view_page.png|View page modified (2011-06-10)
Image:Nviz_cmd_cutting_planes.png‎|Picture of surfaces cut by two planes (generated by nviz_cmd) (2011-06-30)
Image:WxNviz_generate_command.png‎|Command for nviz_cmd generated by wxNviz (2011-07-01)
Image:WxNviz_north_arrow.png‎|North Arrow implemented (2011-07-08)
Image:WxNviz_volumes.png‎|Colored isosurfaces with transparency (2011-07-08)
Image:WxNviz_volume_slices_1.png‎|Partially transparent slice (2011-07-14)
Image:WxNviz_volume_slices_2.png‎|Combination of slices and isosurface (2011-07-14)
Image:WxNviz_overlays.png‎|Raster legend, text label and north arrow (2011-07-22)
Image:WxNviz_thematic_points_colors‎.png|Thematic mapping (colors) for points (2011-08-05)
Image:WxNviz_colorrules_dialog.png|Dialog for {{cmd|v.colors}} opened from 3D view (2011-08-05)
</gallery>
</center>
== Animations ==
{{YouTube|AByFPKHvgu4|desc=Using fly-through mode for creating animation}}


== Roadmap / Progress ==
== Video tutorials ==


=== Done ===
{{YouTube|ib1-mBbWkv4|desc=Loading data, settings layer properties}}
{{YouTube|ZLDstyumxv0|desc=Visualizing fringes and north arrow}}
{{YouTube|CmK-fEyf2SY|desc=3D raster maps (volumes) in the space (isosurface and slice mode)}}
{{YouTube|13wj5KWEweE|desc=Color thematic mapping}}


* Initial cleaning underlying [http://trac.osgeo.org/grass/browser/grass/trunk/lib/ogsf GRASS OpenGL gsurf OGSF Library]
=== Older tutorials (2010) ===
** Doxygenization, code documentation
** Eliminate <tt>fprintf()</tt>, changed to <tt>G_*_message()</tt>, <tt>G_warning()</tt>, <tt>G_fatal_error()</tt>, and <tt>G_debug()</tt>


==== wxGUI Nviz extension ====
{{YouTube|Ej_rBc9sgvE|desc=Loading data, settings layer properties}}
{{YouTube|iWyaBL2Krto|desc=Visualizing fringes}}
{{YouTube|ioE_hHMHqKg|desc=3D raster maps (volumes) in the space}}


* Integration with Layer Manager, (un)loading data when map layer is (un)/checked
== Ideas ==
* Integration with Map Display, auto-rendering functional
* View settings (position, height, perspective, twist, z-exag), perspective can be changed by mouse wheel
* Surface settings (attributes, draw mode)
* Vector 2D/3D points and lines (including boundaries, areas, faces, volumes)
* Saving layer properties in workspace file


What should work:
* Fog support (see [http://gpwiki.org/index.php/OpenGL:Tutorials:Tutorial_Framework:Light_and_Fog], [http://www.swiftless.com/tutorials/opengl/fog.html], [http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=16])
* Vertical labels (take from geonames.org point data): like in http://tev.fbk.eu/marmota/blog/?p=82
* Second interactive light source for isosurface visualization
* Tick marks and coordinate values to x,y,z axis when drawing fringe


* Start GRASS with NC dataset
<strike></strike>
* Add raster map "elevation" and vector map "roadsmajor"
* Start Nviz from Map display toolbar
* Change view, surface attributes, draw mode (try also auto-rendering)
* Enable/disable data layer from Layer Manager


=== In progress ===
== Troubleshooting  ==


* Update OGSF Library documentation
* Nothing is rendered at all:
* Experimental prototype of CLI version of NVIZ (just very simple functionality)
: Please note that with wxGTK port of wxPython (Linux systems), a problem might appear during wxNviz initialization (nothing is rendered at all) or when rendering vectors (bad order of rendering surfaces and vectors). If you encounter such problems, try to change a depth buffer number in wxGUI Menu > Settings > Preferences > Map Display > Advanced (possible numbers are 0, 16, 24, 32). It is currently not possible to automatically find out the right number which is working for your computer.  
::http://trac.osgeo.org/grass/browser/grass/trunk/visualization/nviz2/cmd
* Design experimental <tt>nvizlib</tt> used by CLI and wxPython NVIZ prototype
::http://trac.osgeo.org/grass/browser/grass/trunk/lib/nviz
* Experimental prototype of NVIZ toolbox for wxGUI (based on NVIZ CLI functionality)
::http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/nviz
::http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/nviz.py


==== wxGUI Nviz extension ====
== Known issues  ==


* Support for volumes
#List of [http://trac.osgeo.org/grass/query?status=assigned&status=new&status=reopened&order=priority&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=milestone&keywords=~wxNviz open] and [http://trac.osgeo.org/grass/query?status=assigned&status=closed&order=priority&col=id&col=summary&col=status&col=owner&col=type&col=priority&col=milestone&keywords=~wxNviz closed] tickets
#<strike>Adding vector data crashes wxGUI on Mac</strike>
#<strike>Viewing height sometimes sets to 1 after switching to 2D and back to 3D View (or with the simultaneous 2D view - very nice feature) and even after View is reset, it keeps getting back at 1 each time the slider is touched</strike>
#:Fixed in {{rev|46208}}
#Adding draw, draw current and clear button may be useful
#Thematic mapping is available in GRASS 7 only
#Display region in 3D does not change accordingly to display region in 2D in version &lt;= 6.5
#Appearance:
##&nbsp;I&nbsp;<strike>need to click View tab to get the arrow draw, same for the scale bar </strike>
##add legend &gt; OK: nothing gets drawn in 3D but the legend shows up when I switch to 2D but when I clicked delete scalebar (which was not drawn), my surface disapeared but the legend showed up along with white and black background (which I assume was supposed to be transparent, because when I moved the legend the surface was under it - we already discussed this, it may be my problem, because it works for Michael).
#General
##<strike>when I go from 3D view to 2D and then back to 3D I lose most of my settings&nbsp;</strike>
##<strike>similarly, when I add volume to Map layers I lose my view settings and the 3D view goes back to default </strike>
#Volumes:
##change of region by g.region seems to be ignored (or I missed something), I had to restart GRASS with the new region to get the 3D region for volumes right. Given that the default top, botom is 1,0, if GRASS starts with the default 3D region settings volumes do not work because there is just one level.
##<strike>isosurfaces work with my terrestrial lidar data but the slices don't, it seems that it is due my resolution being 0.3m, when I change it to 1m I get at least some limited slicing
###this may be in ogsf becuase slices in nviz do not work with this data either </strike>
#<strike>changing color to constant did not change the color of the isosurface</strike>


==== Nviz CLI ====
== Comparison of Tcl/Tk nviz and wxNviz functionality ==
What is missing in wxNviz:
* scaled difference
* lighting - follow surface viewpoint
* keyframe animation
* text rendering (in OpenGl)


* To be updated (based on wxGUI Nviz functionality)
What is working only partially:
* legend, labels
* thematic mapping - nviz allows to choose also icon and multiple classification
* basic support of animations


== Screenshots ==
What is new in wxNviz:
* it is possible to change view more interactively using mouse


=== Alpha prototype ===
Notes:
* Scripting functionality is replaced by m.nviz.image module
* wxNviz state is saved in workspace


<center>
{|
|-
| [[Image:Wxnviz-alpha-0.png|250px|thumb|2008-06-27: Display raster map from layer tree in 2.5D (surface)]] ||
[[Image:Wxnviz-alpha-1.png|250px|thumb|2008-07-05: Support for vector data (2D lines) added]]
|-
| [[Image:Wxnviz-alpha-2.png|250px|thumb|2008-07-26: Support for vector point data]] ||
[[Image:Wxnviz-alpha-3.png|250px|thumb|2008-08-02: 3D vector data support]]
|-
| [[Image:Wxnviz-alpha-4.png|250px|thumb|2008-08-09: Initial support for volumetric data]] ||
&nbsp;
|}
</center>


== Ideas ==
== Google Summer of Code ==


* Fog support (see [http://gpwiki.org/index.php/OpenGL:Tutorials:Tutorial_Framework:Light_and_Fog], [http://www.swiftless.com/tutorials/opengl/fog.html], [http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=16])
=== [[wxNviz GSoC 2008|2008]] ===


== Google SoC Reports ==
* [http://trac.osgeo.org/grass/wiki/SoCProjects#wxNvizdevelopmentforenhanced34Dvisualizationandanalysis Accepted Google Summer of Code 2008 project]


# [http://lists.osgeo.org/pipermail/grass-dev/2008-June/038194.html 2008-06-06]
=== [[wxNviz GSoC 2010|2010]] ===
# [http://lists.osgeo.org/pipermail/grass-dev/2008-June/038266.html 2008-06-13]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-June/038353.html 2008-06-20]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-June/038472.html 2008-06-27]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-July/038625.html 2008-07-04]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-July/038753.html 2008-07-11]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-July/038824.html 2008-07-18]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-July/039007.html 2008-07-25]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-August/039181.html 2008-08-01]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-August/039305.html 2008-08-08]
# [http://lists.osgeo.org/pipermail/grass-dev/2008-August/039503.html 2008-08-15]


=== Final report ===
* [http://trac.osgeo.org/grass/wiki/SoCProjects#wxNvizdevelopmentforenhanced34Dvisualizationandanalysis Accepted Google Summer of Code 2010 project]


==== OGSF Library ====
=== [[wxNviz GSoC 2011|2011]] ===


Changes in OGSF library, diff [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4032321&old=grass%2Ftrunk%2Flib%2Fogsf%4031313 before] and [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4032757&old=grass%2Ftrunk%2Flib%2Fogsf%4032585 after] indentation relevant diffs:
* [http://trac.osgeo.org/grass/wiki/SoCProjects#CompletionofwxGUINvizextensionfor3DdatavisualizationinGRASSGIS Accepted Google Summer of Code 2011 project]
* [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4032658&old=grass%2Ftrunk%2Flib%2Fogsf%4032652 diff1]
* [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4032321&old=grass%2Ftrunk%2Flib%2Fogsf%4032034 diff2]
* [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4031684&old=grass%2Ftrunk%2Flib%2Fogsf%4031335 diff3]
* [http://trac.osgeo.org/grass/changeset?new=grass%2Ftrunk%2Flib%2Fogsf%4031323&old=grass%2Ftrunk%2Flib%2Fogsf%4031313 diff4]


==== Nviz command-line module ====
== See also ==


The nviz_cmd module currently supports:
* http://lists.osgeo.org/pipermail/grass-dev/2008-February/035792.html
 
* '''Surfaces''', attributes:
** topography - raster map or constant values used as elevation (z values) for the current surface.
** color - raster map or constant color to drape over the current surface.  
** mask - raster map that controls the areas displayed from the current surface.
** transparency - raster map or constant value that controls the transparency of the current surface. The default is completely opaque.
** shininess - raster map or constant value that controls the shininess (reflectivity) of the current surface.
** emission - raster map or constant value that controls the light emitted from the current surface.
* For each loaded surface draw style:
** mode - coarse,fine,both
** style - wire,surface
** shading - flat,gouraud
** coarse and fine resolution
** wire color
* 2D/3D vector '''line''' features:
** line width, color
** mode - flat,surface (only for 2D)
** height (constant or above surface)
* 2D/3D vector '''point''' features:
** marker size, width, color
** marker - x,sphere,diamond,cube,box,gyro,aster,histogram
* '''Volume'''
** mode - isosurface,slice (currently only isosurface mode implemented)
** shading - flat,gouraud
** position, resolution
* Volume '''isosurface''' mode, attributes:
** level - reference isosurface level (height in map units).
** color - raster map or constant color to drape over the current volume.
** mask - raster map that controls the areas displayed from the current volume.
** transparency - raster map or constant value that controls the transparency of the current volume. The default is completely opaque.
** shininess - raster map or constant value that controls the shininess (reflectivity) of the current volume.
** emission - raster map or constant value that controls the light emitted from the current volume.
* '''Settings'''
** background color
* '''View''' parameters
** position, height, perspective, twist, zexag
* '''Output''' options
** filename, image size (width, height) and format (ppm, tif)


==== wxGUI Nviz extension ====
{{WxGUI}}


[[Category:Development]]
[[Category:NVIZ]]
[[Category:GUI]]
[[Category:Visualization]]
[[Category:Python]]
[[Category:WxGUI]]

Latest revision as of 10:56, 4 December 2018

(Back to wxGUI page.)

wxNviz is a wxGUI extension which allows users to realistically render multiple surfaces (raster data) in a 3D space, optionally using thematic coloring, draping 2D vector data over the surfaces, displaying 3D vector data in the space, and visualization of volume data (3D raster data).

For usage instructions, see also the manual page.

Screenshots

Animations

Using fly-through mode for creating animation

Video tutorials

Loading data, settings layer properties
Visualizing fringes and north arrow
3D raster maps (volumes) in the space (isosurface and slice mode)
Color thematic mapping

Older tutorials (2010)

Loading data, settings layer properties
Visualizing fringes
3D raster maps (volumes) in the space

Ideas

  • Fog support (see [1], [2], [3])
  • Vertical labels (take from geonames.org point data): like in http://tev.fbk.eu/marmota/blog/?p=82
  • Second interactive light source for isosurface visualization
  • Tick marks and coordinate values to x,y,z axis when drawing fringe

Troubleshooting

  • Nothing is rendered at all:
Please note that with wxGTK port of wxPython (Linux systems), a problem might appear during wxNviz initialization (nothing is rendered at all) or when rendering vectors (bad order of rendering surfaces and vectors). If you encounter such problems, try to change a depth buffer number in wxGUI Menu > Settings > Preferences > Map Display > Advanced (possible numbers are 0, 16, 24, 32). It is currently not possible to automatically find out the right number which is working for your computer.

Known issues

  1. List of open and closed tickets
  2. Adding vector data crashes wxGUI on Mac
  3. Viewing height sometimes sets to 1 after switching to 2D and back to 3D View (or with the simultaneous 2D view - very nice feature) and even after View is reset, it keeps getting back at 1 each time the slider is touched
    Fixed in r46208
  4. Adding draw, draw current and clear button may be useful
  5. Thematic mapping is available in GRASS 7 only
  6. Display region in 3D does not change accordingly to display region in 2D in version <= 6.5
  7. Appearance:
    1.  I need to click View tab to get the arrow draw, same for the scale bar
    2. add legend > OK: nothing gets drawn in 3D but the legend shows up when I switch to 2D but when I clicked delete scalebar (which was not drawn), my surface disapeared but the legend showed up along with white and black background (which I assume was supposed to be transparent, because when I moved the legend the surface was under it - we already discussed this, it may be my problem, because it works for Michael).
  8. General
    1. when I go from 3D view to 2D and then back to 3D I lose most of my settings 
    2. similarly, when I add volume to Map layers I lose my view settings and the 3D view goes back to default
  9. Volumes:
    1. change of region by g.region seems to be ignored (or I missed something), I had to restart GRASS with the new region to get the 3D region for volumes right. Given that the default top, botom is 1,0, if GRASS starts with the default 3D region settings volumes do not work because there is just one level.
    2. isosurfaces work with my terrestrial lidar data but the slices don't, it seems that it is due my resolution being 0.3m, when I change it to 1m I get at least some limited slicing
      1. this may be in ogsf becuase slices in nviz do not work with this data either
  10. changing color to constant did not change the color of the isosurface

Comparison of Tcl/Tk nviz and wxNviz functionality

What is missing in wxNviz:

  • scaled difference
  • lighting - follow surface viewpoint
  • keyframe animation
  • text rendering (in OpenGl)

What is working only partially:

  • legend, labels
  • thematic mapping - nviz allows to choose also icon and multiple classification
  • basic support of animations

What is new in wxNviz:

  • it is possible to change view more interactively using mouse

Notes:

  • Scripting functionality is replaced by m.nviz.image module
  • wxNviz state is saved in workspace


Google Summer of Code

2008

2010

2011

See also