Curtis L. Olson wrote:
This sounds like an "interfacing" issue. If you could convert your
lookat/up vectors into heading, pitch, roll, FlightGear would be a lot
happier and all the other FG facilities should fall into place more
easily. The matrix math for the lookat/up -> HPR transformation isn't
exactly trivial (since matrix ops lie outside the bounds of what I'd
personally consider trivial) :-) but there isn't anything especially
hard about it either. Someone more clever than I could probably pump
the lookat/up vectors into gluLookAt(), read back the resulting view
transformation matrix, look at the rows/columns and figure out a way
to extract heading, pitch, roll. Or you might be able to look at what
the gluLookAt() routine does and perhaps gain some insight from that,
or you could just derive your own transformation pipeline. It's all
pretty straightforward stuff as far as matrix transformations go. :-)
There's probably code floating around the FG project to do similar if
not identical things.
That's what I was afraid of having to do. Anyone know of this kind of
code floating around? I tried adding HPR offsets in the configuration
files though since the code I added puts a gluLookAt at the end of the
projection stack, the HPR changes in addition to the lookAt and doesn't
have the desired effect (the projected images no longer form a
continuous image). When the view is changed via the hat on the
joystick, is that done with HPR calculations?
Part of the problem I'm having with this is that when I put the LookAt
in the projection stack, the world (runway, scenery) is rotated, but the
HUD/panel/cockpit are not. For now I turn them off but it would be much
more convincing if they could be rotated too.
Ok, this is one of the ways FlightGear is incredibly cool.
First, pop open the property browser in a live running copy of
FlightGear (it's a menu choice someplace.) Browse around to see the
different data fields that are available. Just about everything
interesting/useful is published in the property system. The browser
allows you to inspect and even change values in the live running copy
of FG.
Now, start up FlightGear with the following option: --telnet=5401 (or
pick your favorite port number.) Once FlightGear is up and running,
go to an xterm/shell on the same machine running flightgear and type
"telnet localhost 5401". You could do this from any machine on the
net by substituting the appropriate machine name/ip-address. From the
telnet session hit enter or type "help" to get a list of available
commands. You can now remotely navigate through the property
structure and examine and change values in the live running copy of
FlightGear. This is very powerful (although low bandwidth) and allows
you to set and change a huge range of values in FlightGear.
Even better, it's pretty easy to automate a remote telnet session so
you can write scripts or code that can remotely control FlightGear in
various ways. I've written a commercial operator GUI that interfaces
to FlightGear in this way. I've scripted (perl) out all the FAA Level
3 FTD certification tests in this way (setting up initial conditions,
reseting the FDM, enabling/adjusting autopilot modes, and even
remotely manipulating control surfaces when needed.)
And you can use the same mechanism to adjust view parameters,
configure weather settings, time of day, etc.
The only draw back is that it's low bandwidth. It's good for setting a
few parameters at a relatively low rate, it's good for interactive
use, it's good for many remote scripting tasks, but you don't want to
use it to try to blast a bunch of position/orientation data in real
time. We have other interfaces better suited for that.
I should also point out that we have an html version of the telnet
interface "--httpd=5400" that allows you to connect up to a live copy
of FlightGear from any web browser and interact with the sim. Just
type in a url like this: "http://localhost:5401/"
That is pretty cool. I couldn't get the scripting to work off the top
of my head but can't see why it wouldn't work. That did help change the
views, among a few other things, thanks :) You've been extremely
helpful Curtis, I really appreciate it.
Patrick
begin:vcard
fn:Patrick Quirk
n:Quirk;Patrick
email;internet:[EMAIL PROTECTED]
tel;work:919-962-1715
x-mozilla-html:FALSE
version:2.1
end:vcard
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d