Board index FlightGear Support Interfacing

Controlling Plane on external monitor

Connecting two computers, using generic protocol, connecting with Matlab?

Controlling Plane on external monitor

Postby hawksnest526 » Sat Dec 26, 2020 8:03 am

Hello! I am new to flightgear, I just got a Sceptre 27 monitor for Christmas and I am extending from my MacBook Pro 2020 base model to the monitor. I am able to open and use flightgear on the monitor but I have to drag the flightgear window to the monitor to use it on the monitor. When I hit tab or right click to control the airplane in control mode, my cursor is moved back to my MacBook, and I have a hard time getting it back to the monitor. It is impossible to get in control mode while on the monitor. Is there a way to fix this? I have been looking and searching around and can't figure it out. I am able to use and control the plane fine on my MacBook, but I wanted to run it on the monitor as it is much larger and looks better.
hawksnest526
 
Posts: 2
Joined: Sat Dec 26, 2020 7:53 am
OS: Mac OS X Big Sur

Re: Controlling Plane on external monitor

Postby tom_nl » Sat Dec 26, 2020 12:56 pm

I had fun in the beginning with my MacBook pro and external monitors (three of them... officially unsupported but it works fine).

Easiest solution, if you don't need the built in screen, once the MacBook is up and running close the lid - it will then only let you use the external monitor, However if you're using the built in keyboard and trackpad that might make things tricky...

Now what I did, I made a custom xml for my displays that tells FG to launch the windows on the external monitor with a certain arrangement. This post is a good reference on how to do it viewtopic.php?f=24&t=36230 .

For an example, here's my custom XML for launching FG on the three external monitors leaving the built in screen unused:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
  <sim>
    <rendering>
      <!-- define camera groups -->
      <camera-group>
        <window>
          <display>0</display>
          <screen>2</screen>
          <name>main</name>
          <x>0</x>
          <y>0</y>
          <host-name type="string">
          </host-name>
            <width>5760</width>
            <height>1200</height>
            <fullscreen type="bool">false</fullscreen>
            <decoration type="bool">false</decoration>
          </window>
                   
          <gui>
            <window>
              <name type="string">main</name>
            </window>
          </gui>
 
          <!-- define middle monitor - master reference -->
        <camera>
          <name type="string">middle</name>
          <window>
            <name type="string">main</name>
          </window>
            <viewport>
            <x>1920</x>
            <y>0</y>
            <width>1920</width>
            <height>1200</height>
          </viewport>
          <view>
            <heading-deg type="double">0`</heading-deg>
          </view>
          <master-perspective>
            <eye-distance type="double">1</eye-distance>
            <!--            <x-offset type="double">-0.05</x-offset> -->
        <y-offset type="double">0.08</y-offset>
            </master-perspective>
        <physical-dimensions>
                       <width>0.55</width>
              <height>0.322</height>
              <bezel>
                <top>0.017</top>
                <left>0.017</left>
                <bottom>0.017</bottom>
                <right>0.017</right>
              </bezel>
            </physical-dimensions>
             </camera>
         
         <!-- define camera 1 - left monitor-->
          <camera>
            <name type="string">left</name>
         
            <window>
              <name>main</name>
            </window>
           
            <viewport>
              <x>0</x>
              <y>0</y>
              <width>1920</width>
              <height>1200</height>
            </viewport>
           
            <view>
              <heading-deg type="double">30</heading-deg>
            </view>
     <left-of-perspective>
            <parent-camera>middle</parent-camera>
          </left-of-perspective>
       <physical-dimensions>
       <width>0.55</width>
              <height>0.360</height>
              <bezel>
                <top>0.017</top>
                <left>0.017</left>
                <bottom>0.017</bottom>
                <right>0.017</right>
              </bezel>
            </physical-dimensions>
        </camera>
        <!-- end of left monitor -->

          <!-- define camera 3 - right monitor -->
          <camera>
            <name type="string">right</name>
            <window>
              <name type="string">main</name>
            </window>
            <viewport>
              <x>3840</x>
              <y>0</y>
              <width>1920</width>
              <height>1200</height>
            </viewport>
            <view>
              <heading-deg type="double">-30</heading-deg>
            </view>
                      <right-of-perspective>
            <parent-camera>middle</parent-camera>
          </right-of-perspective>
       <physical-dimensions>
       <width>0.55</width>
              <height>0.360</height>
              <bezel>
                <top>0.017</top>
                <left>0.017</left>
                <bottom>0.017</bottom>
                <right>0.017</right>
              </bezel>
            </physical-dimensions>
          </camera>
          <!-- end of right monitor -->
        </camera-group>
      </rendering>
    </sim>
  </PropertyList>


You'll need to make a cut down version of this only referencing one monitor (for starters....) to tell FG to launch on the external screen. Probably something like this as a base. There's some comments in the code of what you'll need to change:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
  <sim>
    <rendering>
      <!-- define camera groups -->
      <camera-group>
        <window>
          <display>0</display> <!-- this will be 0 or 1 -->
          <screen>0</screen> <!-- this will be 0 or 1 -->
          <name>main</name>
          <x>0</x>
          <y>0</y>
          <host-name type="string">
          </host-name> <!-- set to resolution of your monitor -->
            <width>1920</width> 
            <height>1080</height>
            <fullscreen type="bool">false</fullscreen>
            <decoration type="bool">false</decoration>
          </window>
                   
          <gui>
            <window>
              <name type="string">main</name>
            </window>
          </gui>
 
          <!-- define middle monitor - master reference -->
        <camera>
          <name type="string">middle</name>
          <window>
            <name type="string">main</name>
          </window>
            <viewport>
            <x>0</x>
            <y>0</y>
            <width>1920</width> <!-- set to resolution of your monitor -->
            <height>1080</height>
          </viewport>
          <view>
            <heading-deg type="double">0`</heading-deg>
          </view>
          <master-perspective>
            <eye-distance type="double">1</eye-distance> <!-- distance from your eye to the screen in metres -->
        <y-offset type="double">0.0</y-offset>
            </master-perspective>
        <physical-dimensions>
                       <width>0.55</width> <!-- width of monitor screen in metres -->
              <height>0.322</height> <!-- height of monitor screen in metres -->
              <bezel> <!-- bezel width in metres - needed for seamless multi-monitor, not needed for single monitor-->
                <top>0.017</top>
                <left>0.017</left>
                <bottom>0.017</bottom>
                <right>0.017</right>
              </bezel>
            </physical-dimensions>
             </camera>
        </camera-group>
      </rendering>
    </sim>
  </PropertyList>


Save it as external_monitor.xml or similar somewhere you can find it. Add this to the launcher on the 'settings' tab, in 'Additional Settings' with the custom launch option --config=<path to file>/external_monitor.xml, then click 'Fly' to see if it launches on the external screen, if not, change the <display> and <screen> numbers as described below until it does.

The key things to change are the <display> and <screen> numbers - most likely they'll be either 0 or 1 - change them until the FG window appears on the screen you want it to. Tip - if you're plugging in via a thunderbolt or USB3 port, make sure to always use the same one or the display assignment changes. Also don't forget to change the resolution to match your monitor and the sizes to match the physical size of the screen, and distance from your eye to the screen itself so you get the correct perspective.

If you're feeling keen, once this is working, you can set up a dual display with the MacBook monitor too (then a third screen, then a fourth screen....).

Tom
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur

Re: Controlling Plane on external monitor

Postby hawksnest526 » Sat Dec 26, 2020 9:20 pm

Thanks Tom! I didn’t even think to shut my MacBook lid, I didn’t think I’d be able to do it. I will give the code a shot at a later time, for now I’m just going to try and enjoy some flying! I really appreciate the help, and when I try the code I’ll update you!
hawksnest526
 
Posts: 2
Joined: Sat Dec 26, 2020 7:53 am
OS: Mac OS X Big Sur


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests