Jim Wilson wrote:
 > Well I haven't done that.  Ideally (perhaps not a good word :)) the
 > panel code would get the orientation from the FGModel class and a
 > panel XYZ from the model's xml file.  We really don't want anything
 > to be dependant on the viewer for that kind of data.

Sure we do (but implicitly; see below).  That's the whole point of a
scene graph -- objects draw themselves into their own coordinate
system, and their "containers", being higher up in the scene graph,
set up the modeling transformation appropriately.

Not only should the panel not be going to the viewer for this
information; it shouldn't be going *anywhere* for the information.  It
should simply spew vertices in the aircraft's coordinate frame at
OpenGL, and expect that everything should work.  That way, you can do
any magic you want to the pilot viewpoint, using as many wacky
parameters as you can think of, and the panel will always render
correctly at its proper location without having to be modified to
support your changes.

The core point being that, right now, the panel draws itself by
erasing the OpenGL matrix stack and starting from scratch.  That is
wrong, and fragile, and leads to the kind of bug you just discovered.
The translation of pilot viewpoint is not something the panel should
ever have to worry about.  The pilot viewpoint translation belongs in
the pilot viewpoint code, and nowhere else.  Everything else shoudl
just use the matrix stack that it's given.

 > How about I publish the model rotation and you can add the panel
 > position XYZ to the translation?

This would work, but like I said, it is fragile.  It ties us to a
particular implementation.  If you want to write new code (say, a
smoothly interpolating chase plane view that uses its own offsets),
the panel will have to be hacked to comply.

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