Re: Flight Gear fro multiple Monitors.
Curtis Olson <[email protected]> Thu, 10 Apr 2014 10:15:07 -0500
| Newsgroups | gmane.games.flightgear.general |
|---|---|
| Message-ID | <CAHtsj_eA4=iO-nB7ex1ViM6df-W1uyfiFZcyDsKa8RG6CbZS4Q@mail.gmail.com> |
--===============5302957564402184544==
Content-Type: multipart/alternative; boundary=001a113634fae0560d04f6b1afaa
--001a113634fae0560d04f6b1afaa
Content-Type: text/plain; charset=ISO-8859-1
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 <[email protected]> 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 <[email protected]>:
> >
> >> 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
> > [email protected]
> > 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
> [email protected]
> 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
--001a113634fae0560d04f6b1afaa
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">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. =A0If 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". =A0 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 vie=
w into the world. =A0So as a result, I shortened my eye point distance from=
the the displays which shows me more of the world, but also introduces som=
e distortions and non-linearities between displays ... it's always a ba=
lancing act between various competing factors. =A0It seems like I had devel=
oped 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 ca=
n then plug into your display configuration file. =A0Figuring out the offse=
t 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 d=
oes.) =A0Here's my script as it is, if anyone wants to play with it.<di=
v>
<br></div><div><div><font face=3D"courier new, monospace">$ cat setup-multi=
headed-config.py</font></div><div><font face=3D"courier new, monospace">#!/=
usr/bin/python</font></div><div><font face=3D"courier new, monospace"># -*-=
coding: utf-8 -*-</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">"""</font></div><div><font face=
=3D"courier new, monospace">This program helps you generate a config file f=
or FlightGear multi-headed</font></div>
<div><font face=3D"courier new, monospace">display systems.</font></div><di=
v><font face=3D"courier new, monospace"><br></font></div><div><font face=3D=
"courier new, monospace">author: Curtis L. Olson</font></div><div><font fac=
e=3D"courier new, monospace">website: <a href=3D"http://www.flightgear.org"=
>www.flightgear.org</a></font></div>
<div><font face=3D"courier new, monospace">started edited: January 2014</fo=
nt></div><div><font face=3D"courier new, monospace">"""</fon=
t></div><div><font face=3D"courier new, monospace"><br></font></div><div><f=
ont face=3D"courier new, monospace">import math</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">near =3D 0.2</font></div><div><font face=3D"cou=
rier new, monospace">far =3D 120000.0</font></div><div><font face=3D"courie=
r new, monospace">decoration =3D "false"</font></div>
<div><font face=3D"courier new, monospace">fullscreen =3D "true"<=
/font></div><div><font face=3D"courier new, monospace">#view_distance =3D 1=
8.1</font></div><div><font face=3D"courier new, monospace">view_distance =
=3D 24.0</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">def get_angle(x, y):</font></div><div><font fac=
e=3D"courier new, monospace">=A0 =A0 theta =3D 2.0 * math.atan2(y*0.5, x)</=
font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 theta_deg =3D theta * 18=
0.0 / math.pi</font></div><div><font face=3D"courier new, monospace">=A0 =
=A0 return theta_deg</font></div><div><font face=3D"courier new, monospace"=
>=A0</font></div>
<div><font face=3D"courier new, monospace">class Screen:</font></div><div><=
font face=3D"courier new, monospace">=A0 =A0 def __init__(self, name=3D&quo=
t;display", diagonal=3D22, hborder=3D1.0,</font></div><div><font face=
=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0xpixels=3D12=
80, ypixels=3D1024):</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 <a href=3D"http:=
//self.name">self.name</a> =3D name</font></div><div><font face=3D"courier =
new, monospace">=A0 =A0 =A0 =A0 self.diag =3D diagonal</font></div><div><fo=
nt face=3D"courier new, monospace">=A0 =A0 =A0 =A0 self.hborder =3D hborder=
</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 self.xpixels =3D=
xpixels</font></div><div><font face=3D"courier new, monospace">=A0 =A0 =A0=
=A0 self.ypixels =3D ypixels</font></div><div><font face=3D"courier new, m=
onospace">=A0 =A0 =A0 =A0 if self.ypixels > 0:</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 self.asp=
ect_ratio =3D float(self.xpixels) / float(self.ypixels)</font></div><div><f=
ont face=3D"courier new, monospace">=A0 =A0 =A0 =A0 else:</font></div><div>=
<font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 print "e=
rror, ypixels cannot be <=3D 0"</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 self.aps=
ect_ratio =3D 1.0</font></div><div><font face=3D"courier new, monospace">=
=A0 =A0 =A0 =A0 self.height =3D math.sqrt( self.diag**2/(1 + self.aspect_ra=
tio**2) )</font></div><div>
<font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 self.width =3D self.h=
eight * self.aspect_ratio</font></div><div><font face=3D"courier new, monos=
pace">=A0 =A0 =A0 =A0 print <a href=3D"http://self.name">self.name</a> + &q=
uot; =3D " + str(self.width) + " x " + str(self.height) \</f=
ont></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 + "=
ar =3D " + str(self.aspect_ratio)</font></div><div><font face=3D"cour=
ier new, monospace"><br></font></div><div><font face=3D"courier new, monosp=
ace">=A0 =A0 def set_view_distance(self, dist=3D36):</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 self.xfov =3D ge=
t_angle( dist, self.width )</font></div><div><font face=3D"courier new, mon=
ospace">=A0 =A0 =A0 =A0 self.yfov =3D get_angle( dist, self.height )</font>=
</div><div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 print <a h=
ref=3D"http://self.name">self.name</a> + " xfov =3D " + str(self.=
xfov)</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 print <a href=3D=
"http://self.name">self.name</a> + " yfov =3D " + str(self.yfov)<=
/font></div><div><font face=3D"courier new, monospace"><br></font></div><di=
v><font face=3D"courier new, monospace">d1 =3D Screen(name=3D"center&q=
uot;, diagonal=3D26.875, hborder=3D1.25,</font></div>
<div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 xpixels=
=3D2560, ypixels=3D1440)</font></div><div><font face=3D"courier new, monosp=
ace">d2 =3D Screen(name=3D"right", diagonal=3D22.0,</font></div><=
div><font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 =A0 =A0 hborder=
=3D0.875, xpixels=3D1680, ypixels=3D1050)</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">d1.set_view_distance(view_distance)</font></div=
><div><font face=3D"courier new, monospace">d2.set_view_distance(view_dista=
nce)</font></div>
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">gap12 =3D d1.hborder + d2.hborder</font></div><=
div><font face=3D"courier new, monospace">pad12 =3D get_angle(view_distance=
, gap12)=A0</font></div>
<div><font face=3D"courier new, monospace">print "border12 pad =3D &qu=
ot; + str(pad12)</font></div><div><font face=3D"courier new, monospace"><br=
></font></div><div><font face=3D"courier new, monospace">d2_heading =3D d1.=
xfov*0.5 + pad12 + d2.xfov*0.5</font></div>
<div><font face=3D"courier new, monospace">print "d2 heading =3D "=
; + str(d2_heading)</font></div><div><br></div><div><br></div></div></div><=
div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Thu, Apr 10=
, 2014 at 6:39 AM, Durk Talsma <span dir=3D"ltr"><<a href=3D"mailto:durk=
[email protected]" target=3D"_blank">[email protected]</a>></span> wrote:<=
br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hi Martin,<br>
<br>
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 t=
o 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.<br>
<br>
Hope this helps.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Durk<br>
</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br>
On 10 Apr 2014, at 12:39, Martin Herweg wrote:<br>
<br>
> Am Thu, 10 Apr 2014 03:48:38 +0000 (UTC)<br>
> schrieb Chaya <<a href=3D"mailto:[email protected]">nisansa=
[email protected]</a>>:<br>
><br>
>> Can somebody please explain how to render flight gear to 3 monitor=
s.<br>
><br>
> <a href=3D"https://gitorious.org/fg/flightgear/raw/d38fcc9979829d2d988=
d63f7bab85a1ef1452543:docs-mini/README.multiscreen" target=3D"_blank">https=
://gitorious.org/fg/flightgear/raw/d38fcc9979829d2d988d63f7bab85a1ef1452543=
:docs-mini/README.multiscreen</a><br>
><br>
> <a href=3D"http://wiki.flightgear.org/Howto:Configure_camera_view_wind=
ows" target=3D"_blank">http://wiki.flightgear.org/Howto:Configure_camera_vi=
ew_windows</a><br>
><br>
> I tried the "shear" and the "frustum" ways to do i=
t but at the moment I<br>
> prefer to have one big (Linux)Desktop over 3 screeens and then stretch=
<br>
> the flightgear window to cover all 3 screens.<br>
><br>
> If you dont fly multiplayer then you can also try th start multiple<br=
>
> instances of Flightgear (see wiki). It is a nice way to manually find<=
br>
> your favorite FOV & angle of the cameras .<br>
><br>
> if you need more assistance, we can meet on skype or mumble<br>
> (Server: <a href=3D"http://mumble.allfex.org" target=3D"_blank">mumble=
.allfex.org</a>)<br>
><br>
><br>
> ----------------------------------------------------------------------=
--------<br>
> Put Bad Developers to Shame<br>
> Dominate Development with Jenkins Continuous Integration<br>
> Continuously Automate Build, Test & Deployment<br>
> Start a new project now. Try Jenkins in the cloud.<br>
> <a href=3D"http://p.sf.net/sfu/13600_Cloudbees" target=3D"_blank">http=
://p.sf.net/sfu/13600_Cloudbees</a><br>
> _______________________________________________<br>
> Flightgear-users mailing list<br>
> <a href=3D"mailto:[email protected]">Flightgear-u=
[email protected]</a><br>
> <a href=3D"https://lists.sourceforge.net/lists/listinfo/flightgear-use=
rs" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/flightge=
ar-users</a><br>
<br>
<br>
---------------------------------------------------------------------------=
---<br>
Put Bad Developers to Shame<br>
Dominate Development with Jenkins Continuous Integration<br>
Continuously Automate Build, Test & Deployment<br>
Start a new project now. Try Jenkins in the cloud.<br>
<a href=3D"http://p.sf.net/sfu/13600_Cloudbees" target=3D"_blank">http://p.=
sf.net/sfu/13600_Cloudbees</a><br>
_______________________________________________<br>
Flightgear-users mailing list<br>
<a href=3D"mailto:[email protected]">Flightgear-users@=
lists.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/flightgear-users" t=
arget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/flightgear-us=
ers</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<div>Curtis Olson:</div><div><a href=3D"http://www.atiak.com/" target=3D"_b=
lank">http://www.atiak.com</a>=A0-=A0<a href=3D"http://aem.umn.edu/~uav/" t=
arget=3D"_blank">http://aem.umn.edu/~uav/</a></div>
<div><a href=3D"http://www.flightgear.org/" target=3D"_blank">http://www.fl=
ightgear.org</a>=A0-=A0<a href=3D"http://gallinazo.flightgear.org/" target=
=3D"_blank">http://gallinazo.flightgear.org</a></div>
</div>
--001a113634fae0560d04f6b1afaa--
--===============5302957564402184544==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
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
--===============5302957564402184544==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Flightgear-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-users
--===============5302957564402184544==--