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 fixed-near-far - bool
142 If true the near and far values are taken from above, if false
143 near and far are adapted from the scene and visibility.
146 offset-x, offset-y - double
147 Offsets of the viewing volume specified by the other parameters in
148 the near plane, in meters.
151 This specifies the perspective viewing volume using values for the near
152 and far planes and coordinates of the viewing rectangle in the near
155 left, bottom - double
157 The coordinates of the viewing rectangle.
160 The near and far planes, in meters from the camera eye point.
162 fixed-near-far - bool
163 If true the near and far values are taken from above, if false
164 near and far are adapted from the scene and visibility.
168 This specifies an orthographic view. The parameters are the sames as
171 fixed-near-far - bool
172 If true the near and far values are taken from above, if false
173 near and far are adapted from the scene and visibility.
177 Defines a persective projection matrix for use as the leading display
178 in a seamless multiscreen configuration. This kind of perspective
179 projection is zoomable.
181 eye-distance - double
182 The distance of the eyepoint from the projection surface in units of
183 the physical-dimensions values above.
185 x-offset, y-offset - double
186 Offset of the eyelpint from the center of the screen in units of
187 the physical-dimensions values above.
189 left-of-perspective, right-of-perspective, above-perspective,
191 Defines a perspective projection matrix for use as derived display
192 in a seamless multiscreen configuration. The projection matrix
193 is computed so that the respective edge of this display matches the
194 assiciated other edge of the other display. For example the right edge
195 of a left-of-perspective display matches the left edge of the parent
196 display. This also works with different zoom levels, leading to distorted
197 but still seamless multiview configurations.
198 The bezel with configured in the physical dimensions of this screen and
199 the parent screen are taken into account for this type of projection.
201 parent-camera - string
202 Name of the parent camera.
204 reference-points-perspective
205 Defines a perspective projection matrix for use as derived display
206 in a seamless multiscreen configuration. This type is very similar to
207 left-of-perspective and friends. It is just a more flexible but less
208 convenient way to get the same effect. A child display is configured
209 by 2 sets of reference points one in this current camera and one in
210 the parrent camera which should match in the final view.
212 parent-camera - string
213 Name of the parent camera.
216 reference points for this projection.
218 point - array of two points
221 x and y coodinates of the reference points in units of this
225 reference points for the parent projection.
227 point - array of two points
230 x and y coodinates of the reference points in units of the
231 parents physical-dimensions.
234 This tag indicates that the camera renders to a texture instead of the
235 framebuffer. For now the following tags are supported, but obviously
236 different texture formats should be specified too.
238 The name of the texture. This can be referred to by other cameras.
239 width, height - double
240 The dimensions of the texture
243 This tag cause the camera to create distortion geometry that
244 corrects for projection onto a spherical screen. It is equivalent to
245 the --panoramic-sd option to osgviewer.
248 The name of a texture, created by another camera, that will be
249 rendered on the distortion correction geometry.
255 size of screen collar.
258 This is a special camera node that displays the 2D GUI.
261 This specifies the position and dimensions of the GUI within a
262 window, *however* at the moment the origin must be at 0,0.
264 Here's an example that uses a single window mapped across 3
265 displays. The displays are in a video wall configuration in a
274 <host-name type="string"></host-name>
278 <height>1024</height>
279 <decoration type = "bool">false</decoration>
289 <height>1024</height>
292 <heading-deg type = "double">0</heading-deg>
296 <bottom>-0.133</bottom>
298 <right>-.1668</right>
305 <name type="string">wide</name>
311 <height>1024</height>
314 <heading-deg type = "double">0</heading-deg>
318 <bottom>-0.133</bottom>
333 <height>1024</height>
336 <heading-deg type = "double">0</heading-deg>
340 <bottom>-0.133</bottom>
349 <name type="string">wide</name>
357 Here's a complete example that uses a seperate window on each
358 display. The displays are arranged in a shallow arc with the left and
359 right displays at a 45.3 degree angle to the center display because,
360 at the assumed screen dimensions, the horizontal field of view of one
361 display is 45.3 degrees. Each camera has its own window definition;
362 the center window is given the name "main" so that the GUI definition
363 can refer to it. Note that the borders of the displays are not
372 <host-name type="string"></host-name>
375 <fullscreen type = "bool">true</fullscreen>
378 <heading-deg type = "double">45.3</heading-deg>
382 <bottom>-0.133</bottom>
391 <name type="string">main</name>
392 <host-name type="string"></host-name>
395 <fullscreen type = "bool">true</fullscreen>
398 <heading-deg type = "double">0</heading-deg>
402 <bottom>-0.133</bottom>
411 <host-name type="string"></host-name>
414 <fullscreen type = "bool">true</fullscreen>
417 <heading-deg type = "double">-45.3</heading-deg>
421 <bottom>-0.133</bottom>
430 <name type="string">main</name>
438 This example renders the scene for projection onto a spherical screen.
446 <name type="string">main</name>
447 <host-name type="string"></host-name>
450 <!-- <fullscreen type = "bool">true</fullscreen>-->
455 <heading-deg type = "double">0</heading-deg>
459 <bottom>-0.133</bottom>
466 <name>mainview</name>
472 <window><name>main</name></window>
481 <panoramic-spherical>
482 <texture>mainview</texture>
483 </panoramic-spherical>
487 <name type="string">main</name>
495 Here is an example for a 3 screen seamless zoomable multiscreen
496 configuration using 3 533mmx300mm displays each with a 23mm bezel.
497 The side views are angled with 45 deg.
498 The commented out reference-points-perspective shows the
499 aequivalent configuration than the active right-of-perspective.
500 This is done by just using two reference points at the outer
501 edge of the bezel of the respective display.
507 <pitch-offset-deg>0.0</pitch-offset-deg>
514 <name type="string">0.0</name>
515 <host-name type="string"></host-name>
518 <fullscreen type="bool">true</fullscreen>
522 <name type="string">0.1</name>
523 <host-name type="string"></host-name>
526 <fullscreen type="bool">true</fullscreen>
530 <name type="string">CenterCamera</name>
538 <height>1080</height>
541 <heading-deg type="double">0.0</heading-deg>
542 <roll-deg type="double">0.0</roll-deg>
543 <pitch-deg type="double">0.0</pitch-deg>
545 <physical-dimensions>
546 <!-- The size of the projection plane: 533mm 300mm -->
555 </physical-dimensions>
557 <!-- Cheating, the real distance is about 800mm.
558 But then the screen does not show what is needed to fly.
559 By shortening this pictures get bigger but the view also gets
562 <eye-distance>450</eye-distance>
563 <x-offset>0</x-offset>
564 <y-offset>130</y-offset>
565 </master-perspective>
568 <name type="string">RightCamera</name>
576 <height>1080</height>
579 <heading-deg type="double">-45</heading-deg>
580 <roll-deg type="double">0</roll-deg>
581 <pitch-deg type="double">0</pitch-deg>
583 <physical-dimensions>
584 <!-- The size of the projection plane: 533mm 300mm -->
593 </physical-dimensions>
594 <right-of-perspective>
595 <parent-camera type="string">CenterCamera</parent-camera>
596 </right-of-perspective>
597 <!-- <reference-points-perspective> -->
598 <!-- <parent-camera type="string">CenterCamera</parent-camera> -->
600 <!-- <point n="0"> -->
601 <!-- <x>289.5</x> -->
604 <!-- <point n="1"> -->
605 <!-- <x>289.5</x> -->
610 <!-- <point n="0"> -->
611 <!-- <x>-289.5</x> -->
614 <!-- <point n="1"> -->
615 <!-- <x>-289.5</x> -->
619 <!-- </reference-points-perspective> -->
623 <name type="string">LeftCamera</name>
631 <height>1080</height>
634 <heading-deg type="double">45</heading-deg>
635 <roll-deg type="double">0</roll-deg>
636 <pitch-deg type="double">0</pitch-deg>
638 <physical-dimensions>
639 <!-- The size of the projection plane: 533mm 300mm -->
648 </physical-dimensions>
649 <left-of-perspective>
650 <parent-camera type="string">CenterCamera</parent-camera>
651 </left-of-perspective>
655 <name type="string">0.0</name>