1 The Open Scene Graph library, which current FlightGear uses for its 3D
2 graphics, provides excellent support for multiple views of a
3 scene. FlightGear uses the osgViewer::Viewer class, which implements a
4 "master" camera with "slave" cameras that are offset from the master's
5 position and orientation. FlightGear provides the "camera group"
6 abstraction which allows the configuration of slave cameras via the
9 Slave cameras can be mapped to windows that are open on different
10 screens, or all in one window, or a combination of those two schemes,
11 according to the video hardware capabilities of a machine. It is not
12 advisable to open more than one window on a single graphics card due
13 to the added cost of OpenGL context switching between the
14 windows. Usually, multiple monitors attached to a single graphics card
15 are mapped to different pieces of the same desktop, so a window can be
16 opened that spans all the monitors. This is implemented by Nvidia's
17 TwinView technology and the Matrox TripleHead2Go hardware.
19 The camera group is configured by the /sim/rendering/camera-group node
20 in the property tree. It can be set up by, among other things, XML in
21 preferences.xml or in an XML file specified on the command line with
24 Here are the XML tags for defining camera groups.
27 For the moment there can be only one camera group. It can contain
28 window, camera, or gui tags.
31 A window defines a graphics window. It can be at the camera-group
32 level or defined within a camera. The window contains these tags:
35 The name of the window which might be displayed in the window's
36 title bar. It is also used to refer to a previously defined
37 window. A window can contain just a name node, in which case
38 the whole window definition refers to a previously defined window.
41 The name of the host on which the window is opened. Usually this is
45 The display number on which the window is opened.
48 The screen number on which the window is opened.
51 The location on the screen at which the window is opened. This is in
52 the window system coordinates, which usually puts 0,0 at the upper
53 left of the screen XXX check this for Windows.
56 The dimensions of the window.
59 Whether the window manager should decorate the window.
62 Shorthand for a window that occupies the entire screen with no
65 overrideRedirect - bool
66 Only effective when fullscreen = true.
67 Provides an extra hint for Gnome-based linux systems that we insist that
68 the full screen window span *all* physical displays, not just the current
72 The camera node contains viewing parameters.
75 This specifies the window which displays the camera. Either it
76 contains just a name that refers to a previous window definition, or
77 it is a full window definition.
80 The viewport positions a camera within a window. It is most useful
81 when several cameras share a window.
84 The position of the lower left corner of the viewport, in y-up
88 The dimensions of the viewport
91 The view node specifies the origin and direction of the camera in
92 relation to the whole camera group. The coordinate system is +y up,
93 -z forward in the direction of the camera group view. This is the
94 same as the OpenGL viewing coordinates.
97 Coordinates of the view origin.
99 heading-deg, pitch-deg, roll-deg - double
100 Orientation of the view in degrees. These are specified using the
101 right-hand rule, so a positive heading turns the view to the left,
102 a positive roll rolls the view to the left.
105 This node is one way of specifying the viewing volume camera
106 parameters. It corresponds to the OpenGL gluPerspective function.
109 The vertical field-of-view
111 aspect-ratio - double
112 Aspect ratio of camera rectangle (not the ratio between the
113 vertical and horizontal fields of view).
116 The near and far planes, in meters from the camera eye point. Note
117 that FlightGear assumes that the far plane is far away, currently
118 120km. The far plane specified here will be respected, but the sky
119 and other background elements may not be drawn if the view plane is
122 offset-x, offset-y - double
123 Offsets of the viewing volume specified by the other parameters in
124 the near plane, in meters.
127 This specifies the perspective viewing volume using values for the near
128 and far planes and coordinates of the viewing rectangle in the near
131 left, bottom - double
133 The coordinates of the viewing rectangle.
136 The near and far planes, in meters from the camera eye point.
139 This specifies an orthographic view. The parameters are the sames as
143 This is a special camera node that displays the 2D GUI.
146 This specifies the position and dimensions of the GUI within a
147 window, *however* at the moment the origin must be at 0,0.
149 Here's an example that uses a single window mapped across 3
150 displays. The displays are in a video wall configuration in a
159 <host-name type="string"></host-name>
163 <height>1024</height>
164 <decoration type = "bool">false</decoration>
174 <height>1024</height>
177 <heading-deg type = "double">0</heading-deg>
181 <bottom>-0.133</bottom>
183 <right>-.1668</right>
190 <name type="string">wide</name>
196 <height>1024</height>
199 <heading-deg type = "double">0</heading-deg>
203 <bottom>-0.133</bottom>
218 <height>1024</height>
221 <heading-deg type = "double">0</heading-deg>
225 <bottom>-0.133</bottom>
234 <name type="string">wide</name>
242 Here's a complete example that uses a seperate window on each
243 display. The displays are arranged in a shallow arc with the left and
244 right displays at a 45.3 degree angle to the center display because,
245 at the assumed screen dimensions, the horizontal field of view of one
246 display is 45.3 degrees. Each camera has its own window definition;
247 the center window is given the name "main" so that the GUI definition
248 can refer to it. Note that the borders of the displays are not
257 <host-name type="string"></host-name>
260 <fullscreen type = "bool">true</fullscreen>
263 <heading-deg type = "double">45.3</heading-deg>
267 <bottom>-0.133</bottom>
276 <name type="string">main</name>
277 <host-name type="string"></host-name>
280 <fullscreen type = "bool">true</fullscreen>
283 <heading-deg type = "double">0</heading-deg>
287 <bottom>-0.133</bottom>
296 <host-name type="string"></host-name>
299 <fullscreen type = "bool">true</fullscreen>
302 <heading-deg type = "double">-45.3</heading-deg>
306 <bottom>-0.133</bottom>
315 <name type="string">main</name>