Results 1 to 12 of 12

Thread: Controlled Animation Question

  1. #1
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280

    Controlled Animation Question

    I have several animated parts on mymodel that need to be controlled by IAS and some by AOA. I have noidea at this point how to enable this. I assume that I will have tocreate a new variable in the model definition file. Are there anyexamples of code available that I could study in relation to what Iwant to achieve?

  2. #2
    Quote Originally Posted by Paul Domingue View Post
    I have several animated parts on mymodel that need to be controlled by IAS and some by AOA. I have noidea at this point how to enable this. I assume that I will have tocreate a new variable in the model definition file. Are there anyexamples of code available that I could study in relation to what Iwant to achieve?
    Hi Paul,

    You can find working tested xml here:

    http://www.aerodynamika.com/cgi-bin/...B.pl?board=XML


    Or, hop over to FSDeveloper to check out their advice.
    Milton
    Dash 7, Aero Commanders, Howard 500, D18S, Spartan Executive, A-26B, Beech XA38 (Grizzly), DH-80A Puss Moth, F7F-1,-3,-3N, AT-11, the "Grumman Seven", Avia Series

    Website has been discontinued

  3. #3
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    Thanks Milton. I posted the same question at FSDevelopers as well but have not checked yet.

  4. #4
    Code:
    <part>
        <name>XXXXXXXX</name>
        <animation>
            <parameter>
                <code>
                                (A:AIRSPEED INDICATED, knots) 250 &gt;
                                if{ 1000 } els{ 0 }
                </code>
                            <lag>200</lag>
            </parameter>
        </animation>
    </part>

    Part Animation:
    Keyframe 0 & Keyframe 1000

    Is IAS slower than 250 Ktn, moved the animation to keyframe 0.
    Is IAS faster than 250 Ktn, moved the animation to keyframe 1000.

    <lag>200</lag> is the maximum speed of movement. 200 key frames/second = 5 secounds from keyframe 0 to keyframe 1000 and vice versa.

  5. #5
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    Quote Originally Posted by Flusirainer View Post
    Code:
    <part>
        <name>XXXXXXXX</name>
        <animation>
            <parameter>
                <code>
                                (A:AIRSPEED INDICATED, knots) 250 &gt;
                                if{ 1000 } els{ 0 }
                </code>
                            <lag>200</lag>
            </parameter>
        </animation>
    </part>

    Part Animation:
    Keyframe 0 & Keyframe 1000

    Is IAS slower than 250 Ktn, moved the animation to keyframe 0.
    Is IAS faster than 250 Ktn, moved the animation to keyframe 1000.

    <lag>200</lag> is the maximum speed of movement. 200 key frames/second = 5 secounds from keyframe 0 to keyframe 1000 and vice versa.
    Thanks for the code sample Flusirainer. It looks relatively simple but since I have not tried adding code to the model def file it will be an interesting exercise. I was woundering if the keyframe 1000 indicates an out of bounds or do I actualy need to have 1000 keyframes in my model animation.

  6. #6
    With Gmax and FSDS but up to 1024 keyframes are possible.

    It is also possible to extend the keyframe animation sequences for a very long time.
    In FS9 I use that for smooth movement of the instruments.

  7. #7
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    I have been digging through as much information as I can but still am at a loss as to how to write what I want to happen in the animation. I have tried several changes but can't grasp what I need to write for it to work. In the following <PartInfo> the only line that works is the first one. How do I have it read each step? I suspect that everything could be written into just the first line but again I have no concept as to how this would be done.
    Now to make things even more complicated I want each increment of the slat animation to call a FS keyboard key press, the F6 and F7 keys. Since the animation is only visual I need it to call a leading edge flap section of the aircraft.cfg so that the lift and drag scalars come into effect.


    Another question is what is the difference between <Code> and <Sim>? I see both being used.


    Oh if only I could write this in Pascal life would be so much easier.


    Your grateful code idiot
    Paul


    Code:
    <PartInfo>
        <Name>su37_slats</Name>
        <AnimLength>1000</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                    (A:AIRSPEED INDICATED, knots) 110 &gt; if{ 148 } els{ 0 }
                    (A:AIRSPEED INDICATED, knots) 130 &gt; if{ 290 } els{ 148 }
                    (A:AIRSPEED INDICATED, knots) 150 &gt; if{ 432 } els{ 290 }
                    (A:AIRSPEED INDICATED, knots) 170 &gt; if{ 574 } els{ 432 }
                    (A:AIRSPEED INDICATED, knots) 190 &gt; if{ 716 } els{ 574 }
                    (A:AIRSPEED INDICATED, knots) 210 &gt; if{ 858 } els{ 716 }
                    (A:AIRSPEED INDICATED, knots) 230 &gt; if{ 1000 } els{ 858 }
                </Code>
            </Parameter>
            <Lag>25</Lag>
        </Animation>
    </PartInfo>

  8. #8
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    I have this code now that works but my math is so rusty I can't quite get proper scale and bias to even out the animation. IAS range is from 140 to 250 and animation length is 920. It's smooth at the high end but not on the low. IAS 250 * 3.4 + 110 = 920 but IAS 141 * 3.4 +110 = 589.4 so that doesn't work quite right. I need to brush up on my algebra 101.
    Code:
    <PartInfo>
      <Name>su37_slats</Name>
      <AnimLength>920</AnimLength>
      <Animation>
       <Parameter>
        <Code>
                        (A:AIRSPEED INDICATED, knots) 140 &lt; if{ 0 } els{ (A:AIRSPEED INDICATED, knots) 3.4 * 110 + }
        </Code>
       </Parameter>
       <Lag>200</Lag>
      </Animation>
        </PartInfo>

  9. #9
    SOH-CM-2013
    Join Date
    Apr 2011
    Location
    Deux-Sevres, France
    Age
    75
    Posts
    316
    I am certainly no expert on .xml programming - I tend to try it & fly it - sometimes with no success, but first guess is that you might need to round off the calculation with 'near' or 'flr' to get a whole number.
    Keith

  10. #10
    How does work the animation?

    140 KIAS = Keyframe 0
    250 KIAS = Keyframe 920

    ???


    ================================================== ==========
    ================================================== ==========
    ================================================== ==========

    250 KIAS - 140 KIAS = 110 KIAS

    920 Keyframes / 110 KIAS = 8.3636 ( 1 KIAS = 8.3636 Keyframes) that means (A:AIRSPEED INDICATED, knots) 8.3636 *

    it follows
    0 KIAS = Keyframe 0
    110 KIAS = Keyframe 920



    How do I get keyframe 0 to 140 KIAS?


    140 KIAS * 8.3636 Keyframes = 1170.9; it must be deducted 1170.9 keyframes
    it follows
    0 KIAS = -1170.9 Keyframes

    (A:AIRSPEED INDICATED, knots) 8.3636 * 1170.9 -


    Code:
        <Code>
                       (A:AIRSPEED INDICATED, knots) 8.3636 * 1170.9 - 
        </Code>

    I hope I have now made no​​ mistake.
    I'm not a specialist. I must it all work out and test.
    I tested it not.

  11. #11
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    Flusirainer, that is what I tried to figure out but my math skills are rusty. I did get it to work with help from Fr. Bill. He pointed out using the stack to store a value. I will take your logic and apply it for my own understanding and try it in the animation. The code now is ......

    Code:
    <PartInfo>
      <Name>su37_slats</Name>
      <AnimLength>1000</AnimLength>
      <Animation>
       <Parameter>
        <Code>
         (A:AIRSPEED INDICATED, knots) s0 140 &lt; if{ 0 }
         l0 140 &gt; if{ 83 }
         l0 150 &gt; if{ 166 }
         l0 160 &gt; if{ 249 }     
         l0 170 &gt; if{ 332 }
         l0 180 &gt; if{ 415 }
         l0 190 &gt; if{ 498 }
         l0 200 &gt; if{ 581 }
         l0 210 &gt; if{ 664 }
         l0 220 &gt; if{ 747 }
         l0 230 &gt; if{ 830 }
         l0 240 &gt; if{ 913 }
         l0 250 &gt; if{ 1000 }
        </Code>
       </Parameter>
       <Lag>400</Lag>
      </Animation>
    </PartInfo>

  12. #12
    SOH-CM-2013 Paul Domingue's Avatar
    Join Date
    Jan 2011
    Location
    Chula Vista, California
    Age
    64
    Posts
    280
    Using your calculations Flusirainer I came up with this.

    Code:
     <PartInfo>
      <Name>su37_slats</Name>
      <AnimLength>1000</AnimLength>
      <Animation>
       <Parameter>
        <Code>
         (A:AIRSPEED INDICATED, knots) 9.0909 * 1272.7272 -
        </Code>
       </Parameter>
       <Lag>400</Lag>
      </Animation>
        </PartInfo>
    Both methods work. Now I am a little further in the "XML for Idiots" hand book.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Prop animation question
    By expat in forum FSX General Discussion
    Replies: 9
    Last Post: March 4th, 2012, 01:16
  2. A question about pilot-controlled runway lights.....
    By Navy Chief in forum FSX General Discussion
    Replies: 3
    Last Post: April 17th, 2011, 17:33
  3. Simple animation question
    By Sid2008 in forum Aircraft Design & Animation
    Replies: 2
    Last Post: November 8th, 2010, 06:08
  4. CFS3 gun animation question
    By crossram in forum Aircraft Design & Animation
    Replies: 4
    Last Post: October 19th, 2010, 12:17
  5. Animation question
    By NCGent in forum FS 2002/2004 General Discussion
    Replies: 17
    Last Post: November 6th, 2008, 18:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Avsim - Flightsim - SimFlight - Simviation - iflyonline - CFS IP - Quarter Moon Saloon - Com-Central