David Megginson wrote:
 > Andy Ross writes:
 > > That's exactly the idea.  You take a "plane of instruments" (what
 > > we're currently calling a panel XML file) and project it into 3D
 > > space via specifying corners.  It draws on top of the existing
 > > stuff, with no problems whatsoever.  If you want to have only one
 > > instrument per panel, that works fine.  Most (well, all) cockpits,
 > > though, have a bunch of flat boards with instruments mounted on
 > > them.  Call each one of those a "panel" and we're done.  All the
 > > work carries over automatically.
 > >
 > > The only code changes required are to allow the corner vertices to
 > > be specified in the configuration (/sim/panels[n]/bottom-left/x-m,
 > > etc...), and allow more than one panel to be created at once.
 > > Maybe there's a need for a "cockpit" xml file to unify some of
 > > this.
 >
 > I don't look at raw OpenGL all that often -- I guess I'll have to do
 > a bit of trig to figure out the transformation, given the corners.
 > If you have even the slightest inclination to try this yourself,
 > please be my guest.

You miss the point.  The code already *does* figure out the
transformation given the corners. :) The only thing you have to do is
fill in the corner coordinates to match the numbers you're already
generating in the model file.

It can be as simple as drawing a named quad to represent the panel in
the cockpit model, grabbing the coordinates from that manually and
typing them into the XML, or as complicated as providing the XML with
the symbolic name of the quad and having the panel work it out.  But
really, there's no math or rendering code required -- you just have to
fill in values for the "a", "b" and "c" vectors in the panel
code. (Well, there's an axis swap involved -- these values are in
OpenGL screen coordinates, not model orientation, so X is left, Y up
and Z backwards).

I'd do this myself, but I'm clueless about cockpit authoring.  What
you have right now is as close as I could come without actually doing
cockpit design. :)

Andy

-- 
Andrew J. Ross                NextBus Information Systems
Senior Software Engineer      Emeryville, CA
[EMAIL PROTECTED]              http://www.nextbus.com
"Men go crazy in conflagrations.  They only get better one by one."
  - Sting (misquoted)


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to