Andy Ross <[EMAIL PROTECTED]> said:

> 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.
> 
Yes this is true, but models move within the scene, and the panel needs to be
located at a given xyz in relation to the model not the scene.  Of course it
could be oriented in the scene as it is now, but it really ought to be placed
in the model, hence the suggestion that the orientation data come from the
FGModel class.

> 
>  > 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.
> 
That isn't true.  I'm only talking about getting a reference from the model in
the scene, as opposed to referencing the scene (viewer or viewmgr) directly
for orientation data. One way to streamline this would be getting a cockpit
matrix from the model class until such time as the panel can be converted to
scene graph.

Once the panel is in a scene graph branch, communication could be done the
other direction. That is, the model class could query the panel class for the
panel's branch and add it to the model.  This seems to likely be the most
intuitive approach and would give us the flexibility to do things like
switching between multiple models each having a panel without having to update
all the panels for all the models all the time.

But currently the conversion of panel to scenegraph isn't done yet and it'd
would be nice to have something that works, until the panel can be recoded.

Best,

Jim

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

Reply via email to