wiki:osgVisualConfiguration

Version 7 (modified by Torben Dannhauer, 12 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 technology to render the scene graph on the screen. You can use all osg related command line options by adding these options to osgVisual.

To get an overview of the available parmeters, execute

osgviewer --help

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="no">
    <distortion channelname="center" renderimplemmentation="fbo" width="2048" height="2048" useshader="yes" hdr="yes" usetexturerectangle="no"></distortion>
  </module>
  <module name="sky_silverlining" enabled="yes"></module>
  <module name="vista2d" enabled="yes">
    <vista2d filename="absolute/path/to/you/vista2DProject.v" paintBackground="no" position_x="1" position_y="1" zoom="1.0" playanimation="yes"></vista2d>
  </module>
  <module name="dataio" enabled="yes">
    <dataio clusterrole="standalone"></dataio>
    <cluster implementation="enet" hardsync="yes" master_ip="10.10.10.10" port="1234" use_zlib_compressor="yes" ></cluster>
    <extlink implementation="vcl" filename="osgVisual.xml"></extlink>
  </module>
  <scenery>
    <terrain filename="relative/or/absolute/path/to/you/database1.ive" filename2="relative/or/absolute/path/to/you/database2.ive"></terrain>
    <animationpath filename="salzburg.path"></animationpath>
    <models>
      <model objectname="TestObject" trackingid="1" label="TestText!" dynamic="no">
        <position lat="47.8123" lon="12.94088" alt="700.0"></position>
        <attitude rot_x="0.0" rot_y="0.0" rot_z="0.0"></attitude>
        <updater>
          <position lat="" lon="" alt=""></position>
          <attitude rot_x="" rot_y="" rot_z=""></attitude>
          <label text=""></label>
        </updater>
        <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>
        <geometry filename="../models/yourModel.flt">
          <offset rot_x="0.0" rot_y="0.0" rot_z="0.0"></offset>
          <scalefactor scale_x="1.0" scale_y="1.0" scale_z="1.0"></scalefactor>
        </geometry>
      </model>
      <trackmodel id="2" updater_slot="TRACKING_ID"></trackmodel> 
    </models>
    <datetime day="0" month="0" year="0" hour="12" minute="50"></datetime>
    <visibility range="50000" turbidity="2.2" ></visibility>
    <clouds>
      <cloudlayer slot="1" type="CUMULUS_CONGESTUS" enabled="yes" fadetime="15">
        <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry>
        <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
      </cloudlayer>
    </clouds>
    <windlayer bottom="500.0" top="1100." speed="25.0" direction="90.0"></windlayer>
  </scenery>
</osgvisualconfiguration>

Module configuration

The "module" sections are parsed while instantiation the modules at the beginning of the 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:

<terrain filename="d:\my\path\database.ive"></terrain>

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>