Howto:Configure camera view windows

From FlightGear wiki
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

Note:This article (inspired by [1]) is currently work in progress, feel free to improve it, at the moment everything here is is based on (and pretty much taken verbatim from) the following discussions:


Required changes in preferences.xml

The latest CVS version of FlightGear uses OpenSceneGraph (OSG) for rendering the scenery. OSG already has an implementation for setting up different cameras looking at the scene and they are configured in preferences.xml.

Slave cameras are created using properties in preferences.xml. One slave is always created that is aligned with the viewing parameters of the master camera. Others can be opened in different graphics windows,possibly on other displays and screens. A slave camera is presently created in its own window.

Parameters for the slave are currently pretty limited; they include:

  • the dimensions and position of the window
  • "shear"values in projection space
  • and "heading-deg," (a heading offset that was added specifically for LinuxTag)

The shear-x and shear-y values are really only useful for setting up a "video wall" type display where monitors arranged around the "master view" show a view in an offset frustum with the same aspect ratio and fov as the master.


So, just add something like this

  <camera>
   <host-name type="string"></host-name>
   <display>0</display>
   <screen>0</screen>
   <shear-x>2</shear-x>
   <shear-y>1</shear-y>
   <width>320</width>
   <height>240</height>
   <fullscreen type="bool">false</fullscreen>
  </camera>
  <camera>
   <host-name type="string"></host-name>
   <display>0</display>
   <screen>0</screen>
   <shear-x>-2</shear-x>
   <shear-y>1</shear-y>
   <width>320</width>
   <height>240</height>
   <fullscreen type="bool">false</fullscreen>
  </camera>

to the <rendering> section of preferences.xml, to simplify maintenance you can also save these modifications in a separate PropertyList-encoded XML file (i.e. toplevel XML node must be named "PropertyList") and simple reference it in preferences.xml by making use of the include attribute in the <rendering section>:

preferences.xml:

 <rendering include="camera-views.xml">
 ...
 </rendering>

camera-views.xml:

<?xml version="1.0"?>
<PropertyList>
  <camera>
   <host-name type="string"></host-name>
   <display>0</display>
   <screen>0</screen>
   <shear-x>2</shear-x>
   <shear-y>1</shear-y>
   <width>320</width>
   <height>240</height>
   <fullscreen type="bool">false</fullscreen>
  </camera>
  <camera>
   <host-name type="string"></host-name>
   <display>0</display>
   <screen>0</screen>
   <shear-x>-2</shear-x>
   <shear-y>1</shear-y>
   <width>320</width>
   <height>240</height>
   <fullscreen type="bool">false</fullscreen>
  </camera>
</PropertyList>