r.out.vrml
Exports a raster map to the Virtual Reality Modeling Language (VRML).
r.out.vrml elevation=name [color=name] [exaggeration=float] output=name [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
r.out.vrml elevation=name output=name
grass.script.run_command("r.out.vrml", elevation, color=None, exaggeration=1.0, output, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("r.out.vrml", elevation="name", output="name")
Parameters
elevation=name [required]
Name of input elevation raster map
color=name
Name of input color map
exaggeration=float
Vertical exaggeration
Default: 1.0
output=name [required]
Name for output VRML file
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
elevation : str, required
Name of input elevation raster map
Used as: input, raster, name
color : str, optional
Name of input color map
Used as: input, raster, name
exaggeration : float, optional
Vertical exaggeration
Default: 1.0
output : str, required
Name for output VRML file
Used as: output, file, name
overwrite: bool, optional
Allow output files to overwrite existing files
Default: False
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
This module exports a GRASS raster map to the Virtual Reality Modeling Language (VRML) format for 3D visualization.
This version only outputs raster maps in VRML 1.0 format. The newer VRML 2.0 format will be more efficient for geographic applications, as it introduces an "ElevationGrid" node so that only the elevation points will have to be written instead of the whole geometry. The vast majority of VRML viewers currently only support VRML 1.0. If the extension "wrl" (world) is not present in the he output parameter, it will be added.
WARNING
VRML is not well suited for large geometries which can result from even a small geographic region. Most viewers seem to bog down with more than 12,000 polygons, depending on your hardware & specific viewer. Each grid cell results in two polygons, so a reasonable size region would be something less than about 75x75. For improved performance and smaller file size, leave off a color map. Since VRML is ascii text, gzip works very well to significantly compress file size.
NOTES
This is a preliminary release of "r.out.vrml". For further information about VRML and available viewers for various platforms, see:
VRML Virtual Reality Modeling Language
BUGS
Currently the region is transformed to a unit size, so real geographic location is lost. Side effects when working in a lat-lon project are that besides general distortion due to projection, a very small exaggeration factor (on order of .001) must be used to compensate for vertical units expected to be the same as map units.
TODO
Update to the more modern GeoVRML format, or probably better the next generation X3D format. See also the Xj3D project.
Future plans for this module are to allow draping of sites objects and vector maps and using the new sites format available in floating point GRASS to embed WWW links into site objects. It will also be upgraded to support VRML 2.0 and will allow entering multiple preset "views" using the existing GRASS 3d_view file format.
Other possible additions:
- Allow animation of elevation, color, or sites based on user interaction.
- Degradation of the raster to produce TINs for improved performance.
AUTHOR
Bill Brown, US Army Construction Engineering Research Laboratory
SOURCE CODE
Available at: r.out.vrml source code
(history)
Latest change: Friday Mar 07 07:39:48 2025 in commit e1e37d8