FlightGear多屏多视口设置方法

在玩FlightGear的过程中,可能需要将视景分角度投影到不同显示器上,或者在一个显示器窗口上投影不同角度的视景。下面记录该需求实现方法。

投影到不同显示器

在FGDATA文件夹根目录下创建camera-views.xml文件夹,写入如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0"?>
<PropertyList>
<camera-group>
<window>
<name type="string">Front</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>0</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</window>

<window>
<name type="string">Right</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>1</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>720</height>
</window>

<gui>
<window>
<name type="string">Front</name>
</window>
</gui>

<camera>
<name type="string">Front</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</viewport>

</camera>
<camera>
<name type="string">Right</name>
<window>
<name>Right</name>
</window>

<view>
<heading-deg type = "double">-45.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1280</width>
<height>720</height>
</viewport>

</camera>
</camera-group>
</PropertyList>

在FGDATA文件夹根目录下找到defaults.xml配置文件,修改如下配置内容,加入camera-views.xml配置文件。

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

投影到窗口不同地方

在FGDATA文件夹根目录下创建camera-views.xml文件夹,写入如下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0"?>
<PropertyList>
<camera-group>
<window>
<name type="string">Front</name>
<host-name type="string"></host-name>
<display>0</display>
<screen>0</screen>
<fullscreen type = "bool">false</fullscreen>
<decoration type = "bool">false</decoration>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</window>

<gui>
<window>
<name type="string">Front</name>
</window>
</gui>

<camera>
<name type="string">Main</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>1920</width>
<height>1080</height>
</viewport>

</camera>
<camera>
<name type="string">Left-Down</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>0</x>
<y>0</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
<camera>
<name type="string">Right-Down</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>1600</x>
<y>0</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
<camera>
<name type="string">Right-Up</name>
<window>
<name>Front</name>
</window>

<view>
<heading-deg type = "double">0.0</heading-deg>
<roll-deg type = "double">0.0</roll-deg>
<pitch-deg type = "double">0.0</pitch-deg>
</view>

<viewport>
<x>1600</x>
<y>900</y>
<width>320</width>
<height>180</height>
</viewport>

</camera>
</camera-group>
</PropertyList>

在FGDATA文件夹根目录下找到defaults.xml配置文件,修改如下配置内容,加入camera-views.xml配置文件。

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

参考链接

  1. Multi-Display setup,by flightgear.
  2. Howto:Configure camera view windows,by flightgear.