Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
  Welcome to our forum.

FFDS Home | TIPS Section | Tutorials Section | Resources Section | Utilities Section

Military | FSDS | Jetliners | Real Planes Section | Gmax | Rotorcraft | Business | Civilian

  HomeHelpSearchLoginRegister  
 
 
Page Index Toggle Pages: 1
Send Topic Print
3D Mach meter gauge and units there of (Read 2079 times)
3rd Mar, 2013 at 6:02pm

David Bushell   Offline
Point Pusher
I Love FFDS!

Posts: 7
*
 
So I have my working 3D xml Mach meter gauge working a treat, but the final part of it is a dial numbered 0-9 that I believe reads off hundredths of a Mach.

My question to the experts here is how I can code the hundredths of a Mach dial since I don't understand the maths behind taking a Mach number eg 1 and then retrieving the hundredths in order to animate a wheel that spins 360 degrees every time the match meter reaches 0.10 Mach.

My part is animated over 100 frames but I've only managed to get it to turn once.....

Any help kindly received.

Thanks

David
 
IP Logged
 
Reply #1 - 4th Mar, 2013 at 4:33pm

David Bushell   Offline
Point Pusher
I Love FFDS!

Posts: 7
*
 
Based on the 3D altimeter example on this forum, I've adjusted for Mach however as said, I don't understand the maths behind working this out:


<PartInfo>      <Name>mach_hundredths</Name>
      <AnimLength>100</AnimLength>
      <Animation>
            <Parameter>
                  <Code>
                        (A:AIRSPEED MACH,mach) * 100
                  </Code>
            </Parameter>
      </Animation>
</PartInfo>

One revolution currently takes place in 100 frames.

I was thinking that perhaps I need to take the Mach Number and multiply it by 100 and then have tht relate to  220 keyframes ie Mach 2.2 x 100 equals 220. But from that point onwards I'm lost??
 
IP Logged
 
Reply #2 - 4th Mar, 2013 at 5:50pm

Tom/FFDS   Offline
YaBB Administrator
Jets are for kids!

Posts: 1584
*****
 
You have to remember that the value of the Value statement will be the keyframe number that will be used to display the dial.

So if you are at 0.86 mach and you use your current code above (assuming the FS variable has a value of 0.86), the dial will be displayed at keyframe 86.  Thus this dial will turn one revolution between mach 0 and mach 1.

From that you should be able to figure out any changes that may be needed. I would assume that you might need to use something like mach x 1000 instead?

Hope this helps,
 

Tom Gibson

California Classic Propliners: Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login or Register

AlcoHauler Locomotive Page: Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login or Register

San Diego Model RR Museum: Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login or Register
IP Logged
 
Reply #3 - 5th Mar, 2013 at 12:49pm

Fr. Bill   Offline
Inspecteur des Polygonnes
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
The drum is keyframed 0 through 9, keys every unit. If you wish the drum to "rotate" leave out the flr command and multiply the extracted digit by 10, set drum keys 0 through 90, with keys every 10 units.

Code:
  <PartInfo>
    <Name>B737_MachSpeed_100ths</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:AIRSPEED MACH,mach) 1000 * 9999.99 min 0 max 10 % 1 / flr
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
 

 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Reply #4 - 5th Mar, 2013 at 5:55pm

David Bushell   Offline
Point Pusher
I Love FFDS!

Posts: 7
*
 
Hi Bill, Tom,

Thank you for your pointers. Out of curiosity, what does the flr text mean?

I managed to get the gauge working with a combination of your answers.

Many thanks

David.
 
IP Logged
 
Reply #5 - 6th Mar, 2013 at 10:34am

Fr. Bill   Offline
Inspecteur des Polygonnes
I used to have a life:
now I have GMax...
Hammond, IN

Gender: male
Posts: 5426
*****
 
David Bushell wrote on 5th Mar, 2013 at 5:55pm:
Thank you for your pointers. Out of curiosity, what does the flr text mean?

David, the SDK states this for the "flr" command:
Quote:
number which is less than the source number

Essentially, it rounds down so that you will always have a single digit integer.

So, from 5.0 to 5.9 the result will always be 5
That is why I suggested that if you wish the drum to rotate slowly between the numbers, you remove the "flr" command and expand the keyframe range by 10x...  Cool
 

Fr. Bill
Gauge Programming - 3d Modeling Eaglesoft Development Group Intel Core 2 Quad Q6600-4 GB DDRII Crucial PC6400-500 GB SATA-ATI Radeon HD2400 Pro 256MB
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print