Victhor wrote:
> Recently, I made a 3D instrument for the very good KLN 89 GPS unit in
> FlightGear. I was able to correctly position its screen inside the
> screen area in the model, but I ran into some issues, more exactly with
> the way the unit is controlled.
> The bindings for the button hotspots look like this on the XML of the 2D
> instrument:
>
>           <action>
>            <name>MSG Button</name>
>            <button>0</button>
>            <x>-285</x>
>            <y>-122</y>
>            <w>50</w>
>            <h>35</h>
>           <binding>
>             <command>kln89_msg_pressed</command>
>            </binding>
>           </action>
>
> I tried doing something similar on the 3D model, only for it not to
> work. The object shows the yellow border around it, but nothing happens
> when the button is pressed.
>
>     <animation>
>         <type>pick</type>
>         <object-name>msg</object-name>
>         <action>
>             <button>1</button>
>             <repeatable>false</repeatable>
>   <binding>
>     <command>kln89_msg_pressed</command>
>    </binding>
>         </action>
>     </animation>
>
> Pressing the "MSG" button would bring up the message screen, displaying
> "No message" on the screen. It works as expected on the 2D instrument.
> I tried looking on the property tree, but I don't find anything relating
> to the KLN 89's operation, except a prop that is used to animate a
> push/pull knob.
> So, how is this instrument controlled? I don't see nasal files for it.
>
>   

Hi Victor,

The callback functions for the buttons are defined and registered in the 
file kln89.cxx in src/Instrumentation/kln89 - there is no nasal glue for 
the kln89.  I'm not sure why your buttons are not working, but if you 
want to send me your code off-list I'll take a look.

However, I'm not sure that it's currently possible to use the display in 
a 3D instrument without source code modifications.  It currently draws 
raw opengl in 2D directly to the screen.  Having said that, I *think* it 
uses the same mechanism as the panel hot spots, and I seem to recall 
that they work on the 3D panels?  On my todo list is to render the 
display to texture like the weather radar is, so it can be properly used 
in a 3D instrument.  I'd be interested to know how you are getting on - 
do you see the display properly on your 3D instrument, but just without 
the buttons working?

Cheers - Dave

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to