wiki:osgVisualConfiguration

Version 3 (modified by Torben Dannhauer, 14 years ago) (diff)

--

osgVisual configuration

To use osgVisual, you have to configure osgVisual according to your needs.

Basiccally, osgVisual provides two configuration mechanisms:

  • Via commandline parameters
  • Via configuration file

Configuration via parameters

osgVisual is build on top of OpenSceneGraph. The core module is osgViewer which provides all the background technolog< to render the scene graph on the screen. You can use all osg and osgVisuer related command line options by adding these options to osgVisual.

To get an overview of the available parmeters, execute

osgviewer

or go to http://www.openscenegraph.org

Configuration via configuration file

For all options which are not OSG but osgVisual related, the configuration mechanism is an XML configuration file. This file contains sections for each module to configure and for the scenery to display.

Example of a configuration file with module and scenery configuration:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<osgvisualconfiguration>
  <module name="distortion" enabled="yes">
    <distortion channelname="center"></distortion>
  </module>
  <module name="sky_silverlining" enabled="yes"></module>
  
  <scenery>
    <terrain filename="d:\my\path\database.ive"></terrain>
    <animationpath filename="salzburgerEcke.path"></animationpath>
    <models>
      <model filename="cessna" type="plain" label="TestText!" dynamic="yes">
        <position lat="47.12345" lon="11.234567" alt="1500.0"></position>
        <attitude rot_x="0.0" rot_y="0.0" rot_z="0.0"></attitude>
        <cameraoffset>
          <translation trans_x="0.0" trans_y="0.0" trans_z="0.0"></translation>
          <rotation rot_x="0.0" rot_y="0.0" rot_z="0.0"></rotation>
        </cameraoffset>
      </model>
    </models>
    <datetime day="01" month="02" year="2010" hour="23" minute="45"></datetime>
    <visibility range="50000" turbidity="2.2" ></visibility>
    <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15">
      <geometry baselength="50000" basewidth="50000" thickness="500" baseHeight="1700" density="0.3"></geometry>
      <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
    </cloudlayer>
    <windlayer bottom="500.0" top="700." speed="25.0" direction="90.0"></windlayer>
  </scenery>
</osgvisualconfiguration>

Module configuration

The "module" sections are parsed while instantiation the modules at the beginning of steh startup process. Each module configuration contains at least the name and the enabled/disabled status of the module. Further module parameters are optional and module dependent.

Example:

  <module name="distortion" enabled="yes">
    <distortion channelname="center"></distortion>
  </module>

Scenery configuration

Terrain

Example:

  <module name="distortion" enabled="yes">
    <distortion channelname="center"></distortion>
  </module>

Sky/Weather?

Example:

 <datetime day="01" month="02" year="2010" hour="23" minute="45"></datetime>
    <visibility range="50000" turbidity="2.2" ></visibility>
    <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15">
      <geometry baselength="50000" basewidth="50000" thickness="500" baseHeight="1700" density="0.3"></geometry>
      <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
    </cloudlayer>
    <windlayer bottom="500.0" top="700." speed="25.0" direction="90.0"></windlayer>

Models

Example:

    <models>
      <model filename="cessna" type="plain" label="TestText!" dynamic="yes">
        <position lat="47.12345" lon="11.234567" alt="1500.0"></position>
        <attitude rot_x="0.0" rot_y="0.0" rot_z="0.0"></attitude>
        <cameraoffset>
          <translation trans_x="0.0" trans_y="0.0" trans_z="0.0"></translation>
          <rotation rot_x="0.0" rot_y="0.0" rot_z="0.0"></rotation>
        </cameraoffset>
      </model>
    </models>