Not long ago I was playing with a python script to try to assist me in
creating an optimal 'life size' config for a 3 display system.  If you
input the actual physical size of your screen and actual distance from your
eye, you can setup the field of view on screen to match the real world so
all objects are "life size".   Unfortunately I (and I'm sure most of us)
don't have life size monitor coverage so even with 3 displays, you end up
feeling like you have a constrained view into the world.  So as a result, I
shortened my eye point distance from the the displays which shows me more
of the world, but also introduces some distortions and non-linearities
between displays ... it's always a balancing act between various competing
factors.  It seems like I had developed the script further, but I must have
only thought about developing the script further ... as it stands it helps
calculate a few values that you can then plug into your display
configuration file.  Figuring out the offset angle for the side displays so
that runway lines and the horizon line up is always the hardest part for me
(and that's mainly what this script does.)  Here's my script as it is, if
anyone wants to play with it.

$ cat setup-multiheaded-config.py
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
This program helps you generate a config file for FlightGear multi-headed
display systems.

author: Curtis L. Olson
website: www.flightgear.org
started edited: January 2014
"""

import math

near = 0.2
far = 120000.0
decoration = "false"
fullscreen = "true"
#view_distance = 18.1
view_distance = 24.0

def get_angle(x, y):
    theta = 2.0 * math.atan2(y*0.5, x)
    theta_deg = theta * 180.0 / math.pi
    return theta_deg

class Screen:
    def __init__(self, name="display", diagonal=22, hborder=1.0,
                 xpixels=1280, ypixels=1024):
        self.name = name
        self.diag = diagonal
        self.hborder = hborder
        self.xpixels = xpixels
        self.ypixels = ypixels
        if self.ypixels > 0:
            self.aspect_ratio = float(self.xpixels) / float(self.ypixels)
        else:
            print "error, ypixels cannot be <= 0"
            self.apsect_ratio = 1.0
        self.height = math.sqrt( self.diag**2/(1 + self.aspect_ratio**2) )
        self.width = self.height * self.aspect_ratio
        print self.name + " = " + str(self.width) + " x " +
str(self.height) \
            + " ar = " + str(self.aspect_ratio)

    def set_view_distance(self, dist=36):
        self.xfov = get_angle( dist, self.width )
        self.yfov = get_angle( dist, self.height )
        print self.name + " xfov = " + str(self.xfov)
        print self.name + " yfov = " + str(self.yfov)

d1 = Screen(name="center", diagonal=26.875, hborder=1.25,
            xpixels=2560, ypixels=1440)
d2 = Screen(name="right", diagonal=22.0,
            hborder=0.875, xpixels=1680, ypixels=1050)

d1.set_view_distance(view_distance)
d2.set_view_distance(view_distance)

gap12 = d1.hborder + d2.hborder
pad12 = get_angle(view_distance, gap12)
print "border12 pad = " + str(pad12)

d2_heading = d1.xfov*0.5 + pad12 + d2.xfov*0.5
print "d2 heading = " + str(d2_heading)




On Thu, Apr 10, 2014 at 6:39 AM, Durk Talsma <durkt...@gmail.com> wrote:

> Hi Martin,
>
> Please remind me in case I forget, but I could send you a config file I'm
> using myself. I'm also using one big desktop. In essence, you need to tell
> each camera to render to XScreen 1 (or zero, typing this off the top of my
> head). Then, the left screen should have offset 0, the center screen an X
> offset of whatever your monitor resolution is, and your right screen, twice
> that offset.
>
> Hope this helps.
>
> Durk
>
> On 10 Apr 2014, at 12:39, Martin Herweg wrote:
>
> > Am Thu, 10 Apr 2014 03:48:38 +0000 (UTC)
> > schrieb Chaya <nisansala_ar...@yahoo.com>:
> >
> >> Can somebody please explain how to render flight gear to 3 monitors.
> >
> >
> https://gitorious.org/fg/flightgear/raw/d38fcc9979829d2d988d63f7bab85a1ef1452543:docs-mini/README.multiscreen
> >
> > http://wiki.flightgear.org/Howto:Configure_camera_view_windows
> >
> > I tried the "shear" and the "frustum" ways to do it but at the moment I
> > prefer to have one big (Linux)Desktop over 3 screeens and then stretch
> > the flightgear window to cover all 3 screens.
> >
> > If you dont fly multiplayer then you can also try th start multiple
> > instances of Flightgear (see wiki). It is a nice way to manually find
> > your favorite FOV & angle of the cameras .
> >
> > if you need more assistance, we can meet on skype or mumble
> > (Server: mumble.allfex.org)
> >
> >
> >
> ------------------------------------------------------------------------------
> > Put Bad Developers to Shame
> > Dominate Development with Jenkins Continuous Integration
> > Continuously Automate Build, Test & Deployment
> > Start a new project now. Try Jenkins in the cloud.
> > http://p.sf.net/sfu/13600_Cloudbees
> > _______________________________________________
> > Flightgear-users mailing list
> > Flightgear-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/flightgear-users
>
>
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> _______________________________________________
> Flightgear-users mailing list
> Flightgear-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-users
>



-- 
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org - http://gallinazo.flightgear.org
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Flightgear-users mailing list
Flightgear-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-users

Reply via email to