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
66 The camera node contains viewing parameters.
69 This specifies the window which displays the camera. Either it
70 contains just a name that refers to a previous window definition, or
71 it is a full window definition.
74 The viewport positions a camera within a window. It is most useful
75 when several cameras share a window.
78 The position of the lower left corner of the viewport, in y-up
82 The dimensions of the viewport
85 The physical dimension of the projection surface.
86 Use this together with the master-perspective, right-of-perspective
87 left-of-perspective, above-perspective, below-perspective or
88 reference-points-perspective
90 width, height - double
91 The dimensions of the projection plane, if unset the veiwport values
95 Gives informantion about the bezel of monitors for a seamless view.
98 right bezel with in the same units than with and height above
101 left bezel with in the same units than with and height above
104 top bezel with in the same units than with and height above
107 bottom bezel with in the same units than with and height above
110 The view node specifies the origin and direction of the camera in
111 relation to the whole camera group. The coordinate system is +y up,
112 -z forward in the direction of the camera group view. This is the
113 same as the OpenGL viewing coordinates.
116 Coordinates of the view origin.
118 heading-deg, pitch-deg, roll-deg - double
119 Orientation of the view in degrees. These are specified using the
120 right-hand rule, so a positive heading turns the view to the left,
121 a positive roll rolls the view to the left.
124 This node is one way of specifying the viewing volume camera
125 parameters. It corresponds to the OpenGL gluPerspective function.
128 The vertical field-of-view
130 aspect-ratio - double
131 Aspect ratio of camera rectangle (not the ratio between the
132 vertical and horizontal fields of view).
135 The near and far planes, in meters from the camera eye point. Note
136 that FlightGear assumes that the far plane is far away, currently
137 120km. The far plane specified here will be respected, but the sky
138 and other background elements may not be drawn if the view plane is
141 offset-x, offset-y - double
142 Offsets of the viewing volume specified by the other parameters in
143 the near plane, in meters.
146 This specifies the perspective viewing volume using values for the near
147 and far planes and coordinates of the viewing rectangle in the near
150 left, bottom - double
152 The coordinates of the viewing rectangle.
155 The near and far planes, in meters from the camera eye point.
158 This specifies an orthographic view. The parameters are the sames as
162 Defines a persective projection matrix for use as the leading display
163 in a seamless multiscreen configuration. This kind of perspective
164 projection is zoomable.
166 eye-distance - double
167 The distance of the eyepoint from the projection surface in units of
168 the physical-dimensions values above.
170 x-offset, y-offset - double
171 Offset of the eyelpint from the center of the screen in units of
172 the physical-dimensions values above.
174 left-of-perspective, right-of-perspective, above-perspective,
176 Defines a perspective projection matrix for use as derived display
177 in a seamless multiscreen configuration. The projection matrix
178 is computed so that the respective edge of this display matches the
179 assiciated other edge of the other display. For example the right edge
180 of a left-of-perspective display matches the left edge of the parent
181 display. This also works with different zoom levels, leading to distorted
182 but still seamless multiview configurations.
183 The bezel with configured in the physical dimensions of this screen and
184 the parent screen are taken into account for this type of projection.
186 parent-camera - string
187 Name of the parent camera.
189 reference-points-perspective
190 Defines a perspective projection matrix for use as derived display
191 in a seamless multiscreen configuration. This type is very similar to
192 left-of-perspective and friends. It is just a more flexible but less
193 convenient way to get the same effect. A child display is configured
194 by 2 sets of reference points one in this current camera and one in
195 the parrent camera which should match in the final view.
197 parent-camera - string
198 Name of the parent camera.
201 reference points for this projection.
203 point - array of two points
206 x and y coodinates of the reference points in units of this
210 reference points for the parent projection.
212 point - array of two points
215 x and y coodinates of the reference points in units of the
216 parents physical-dimensions.
219 This tag indicates that the camera renders to a texture instead of the
220 framebuffer. For now the following tags are supported, but obviously
221 different texture formats should be specified too.
223 The name of the texture. This can be referred to by other cameras.
224 width, height - double
225 The dimensions of the texture
228 This tag cause the camera to create distortion geometry that
229 corrects for projection onto a spherical screen. It is equivalent to
230 the --panoramic-sd option to osgviewer.
233 The name of a texture, created by another camera, that will be
234 rendered on the distortion correction geometry.
240 size of screen collar.
243 This is a special camera node that displays the 2D GUI.
246 This specifies the position and dimensions of the GUI within a
247 window, *however* at the moment the origin must be at 0,0.
249 Here's an example that uses a single window mapped across 3
250 displays. The displays are in a video wall configuration in a
259 <host-name type="string"></host-name>
263 <height>1024</height>
264 <decoration type = "bool">false</decoration>
274 <height>1024</height>
277 <heading-deg type = "double">0</heading-deg>
281 <bottom>-0.133</bottom>
283 <right>-.1668</right>
290 <name type="string">wide</name>
296 <height>1024</height>
299 <heading-deg type = "double">0</heading-deg>
303 <bottom>-0.133</bottom>
318 <height>1024</height>
321 <heading-deg type = "double">0</heading-deg>
325 <bottom>-0.133</bottom>
334 <name type="string">wide</name>
342 Here's a complete example that uses a seperate window on each
343 display. The displays are arranged in a shallow arc with the left and
344 right displays at a 45.3 degree angle to the center display because,
345 at the assumed screen dimensions, the horizontal field of view of one
346 display is 45.3 degrees. Each camera has its own window definition;
347 the center window is given the name "main" so that the GUI definition
348 can refer to it. Note that the borders of the displays are not
357 <host-name type="string"></host-name>
360 <fullscreen type = "bool">true</fullscreen>
363 <heading-deg type = "double">45.3</heading-deg>
367 <bottom>-0.133</bottom>
376 <name type="string">main</name>
377 <host-name type="string"></host-name>
380 <fullscreen type = "bool">true</fullscreen>
383 <heading-deg type = "double">0</heading-deg>
387 <bottom>-0.133</bottom>
396 <host-name type="string"></host-name>
399 <fullscreen type = "bool">true</fullscreen>
402 <heading-deg type = "double">-45.3</heading-deg>
406 <bottom>-0.133</bottom>
415 <name type="string">main</name>
423 This example renders the scene for projection onto a spherical screen.
431 <name type="string">main</name>
432 <host-name type="string"></host-name>
435 <!-- <fullscreen type = "bool">true</fullscreen>-->
440 <heading-deg type = "double">0</heading-deg>
444 <bottom>-0.133</bottom>
451 <name>mainview</name>
457 <window><name>main</name></window>
466 <panoramic-spherical>
467 <texture>mainview</texture>
468 </panoramic-spherical>
472 <name type="string">main</name>
480 Here is an example for a 3 screen seamless zoomable multiscreen
481 configuration using 3 533mmx300mm displays each with a 23mm bezel.
482 The side views are angled with 45 deg.
483 The commented out reference-points-perspective shows the
484 aequivalent configuration than the active right-of-perspective.
485 This is done by just using two reference points at the outer
486 edge of the bezel of the respective display.
492 <pitch-offset-deg>0.0</pitch-offset-deg>
499 <name type="string">0.0</name>
500 <host-name type="string"></host-name>
503 <fullscreen type="bool">true</fullscreen>
507 <name type="string">0.1</name>
508 <host-name type="string"></host-name>
511 <fullscreen type="bool">true</fullscreen>
515 <name type="string">CenterCamera</name>
523 <height>1080</height>
526 <heading-deg type="double">0.0</heading-deg>
527 <roll-deg type="double">0.0</roll-deg>
528 <pitch-deg type="double">0.0</pitch-deg>
530 <physical-dimensions>
531 <!-- The size of the projection plane: 533mm 300mm -->
540 </physical-dimensions>
542 <!-- Cheating, the real distance is about 800mm.
543 But then the screen does not show what is needed to fly.
544 By shortening this pictures get bigger but the view also gets
547 <eye-distance>450</eye-distance>
548 <x-offset>0</x-offset>
549 <y-offset>130</y-offset>
550 </master-perspective>
553 <name type="string">RightCamera</name>
561 <height>1080</height>
564 <heading-deg type="double">-45</heading-deg>
565 <roll-deg type="double">0</roll-deg>
566 <pitch-deg type="double">0</pitch-deg>
568 <physical-dimensions>
569 <!-- The size of the projection plane: 533mm 300mm -->
578 </physical-dimensions>
579 <right-of-perspective>
580 <parent-camera type="string">CenterCamera</parent-camera>
581 </right-of-perspective>
582 <!-- <reference-points-perspective> -->
583 <!-- <parent-camera type="string">CenterCamera</parent-camera> -->
585 <!-- <point n="0"> -->
586 <!-- <x>289.5</x> -->
589 <!-- <point n="1"> -->
590 <!-- <x>289.5</x> -->
595 <!-- <point n="0"> -->
596 <!-- <x>-289.5</x> -->
599 <!-- <point n="1"> -->
600 <!-- <x>-289.5</x> -->
604 <!-- </reference-points-perspective> -->
608 <name type="string">LeftCamera</name>
616 <height>1080</height>
619 <heading-deg type="double">45</heading-deg>
620 <roll-deg type="double">0</roll-deg>
621 <pitch-deg type="double">0</pitch-deg>
623 <physical-dimensions>
624 <!-- The size of the projection plane: 533mm 300mm -->
633 </physical-dimensions>
634 <left-of-perspective>
635 <parent-camera type="string">CenterCamera</parent-camera>
636 </left-of-perspective>
640 <name type="string">0.0</name>