Board index FlightGear Development Aircraft Cockpit development

The <interpolation> feature work only with positive values ?  Topic is solved

Discussion about creating 2d and 3d cockpits.

The <interpolation> feature work only with positive values ?

Postby abassign » Tue Sep 26, 2017 8:01 am

The <interpolation> feature work only with positive values ?
I'm building some gauge, but when I made a variometer, which does not have a linear scale, I used the <interpolation> function in <amimation>.

This is the vario:

Image

Code: Select all
<animation>
        <type>rotate</type>
        <object-name>pointer A (Meshed)</object-name>
        <property>/instrumentation/vertical-speed-indicator/indicated-speed-fpm</property>
        <interpolation>
            <entry><ind>-6000</ind><dep>95</dep></entry>
            <entry><ind>-2500</ind><dep>180</dep></entry>
            <entry><ind>0</ind><dep>270</dep></entry>
            <entry><ind>2500</ind><dep>0</dep></entry>
            <entry><ind>6000</ind><dep>85</dep></entry>
        </interpolation>
        <axis>
            <x>  -1 </x>
            <y>  0 </y>
            <z>  0 </z>
        </axis>
    </animation>


It only works as if I had entered positive values, it seems to ignore the negative values. How can I fix this problem?

P.S:
If I work with the classic linear function, there are no problems, everything works perfect.
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10

Re: The <interpolation> feature work only with positive valu

Postby Alant » Tue Sep 26, 2017 9:31 am

See fgdata/Aircraft/Instruments-3D/vsi for a working example.

Alan
Alant
 
Posts: 1219
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: The <interpolation> feature work only with positive valu  

Postby abassign » Tue Sep 26, 2017 10:59 am

Alant wrote in Tue Sep 26, 2017 9:31 am:See fgdata/Aircraft/Instruments-3D/vsi for a working example.

Alan


Thanks for your suggestion, it works perfectly, since the criterion is not absolute but relative to the zero of the instrument.

I have corrected the code in this way:

Code: Select all
<animation>
        <type>rotate</type>
        <object-name>pointer A (Meshed)</object-name>
        <object-name>pointer B (Meshed)</object-name>
        <property>/instrumentation/vertical-speed-indicator/indicated-speed-fpm</property>
        <interpolation>
            <entry><ind>-6000</ind><dep>-185.0</dep></entry>
            <entry><ind>-5000</ind><dep>-155.0</dep></entry>
            <entry><ind>-4000</ind><dep>-134.0</dep></entry>
            <entry><ind>-3000</ind><dep>-112.0</dep></entry>
            <entry><ind>-2000</ind><dep>-80.0</dep></entry>
            <entry><ind>-1000</ind><dep>-48.0</dep></entry>
            <entry><ind>-500</ind><dep>-25.0</dep></entry>
            <entry><ind>0</ind><dep>0</dep></entry>
            <entry><ind>500</ind><dep>25.0</dep></entry>
            <entry><ind>1000</ind><dep>48.0</dep></entry>
            <entry><ind>2000</ind><dep>80.0</dep></entry>
            <entry><ind>3000</ind><dep>112.0</dep></entry>
            <entry><ind>4000</ind><dep>134.0</dep></entry>
            <entry><ind>5000</ind><dep>155.0</dep></entry>
            <entry><ind>6000</ind><dep>175.0</dep></entry>
        </interpolation>
        <axis>
            <x>  -1 </x>
            <y>  0 </y>
            <z>  0 </z>
        </axis>
    </animation>
Developer of the program https://wiki.flightgear.org/Julia_photoscenery_generator
FDM developer of the G91R1B aircraft https://wiki.flightgear.org/FIAT_G91R1B
JSBSim collaborator
abassign
 
Posts: 947
Joined: Mon Feb 27, 2012 6:09 pm
Location: Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2020.4
OS: Ubuntu 20.10


Return to Cockpit development

Who is online

Users browsing this forum: No registered users and 2 guests