An "Integrating" expression for Flame?

Home Page forums fx Art and Technique Expressions for VFX An "Integrating" expression for Flame?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #202822
    c64
    Participant

    Hi People,

    I wonder if anyone can help me out. I have a channel curve in Flame (axis1.position.y). I am trying to create another channel (axis2.position.y) which is an integration of the curve (axis1.position.y), ie an approximation of the area under the curve. Is it possible using an expression?

    Why would I want to do this? It’s nerdy, but I have a butterfly. It’s looped wingflap cycle has a timewarp curve. I want to use this timewarp curve to help dictate the relative y position of the butterfly!

    Any clues would be awesome, otherwise I will have to resort back to artistic interpretation 😉

    Cheers,
    Mike

    #217786
    Anonymous
    Inactive

    Hmmm,

    The area, by definition needs a value approximation over a multitude of frames. You’d need to calculate every frames discretely and add them in a function. But this would mean an ever expanding function to accomodate for every frame. So, I guess that is not possible.

    Maybe you could work out an expression which relies on the difference between two consecutive frames. That would be the derivative though just opposite of what you are asking.

    You would then calculate the difference between to frames and use it in an expression:

    eval(axis1.position.y,frame-1)-eval(axis1.position.y,frame-2)

    Hope this somehow helps.

    Sinan Vural

    #217787
    Kjell
    Participant

    i want to thank you both for making my head asplode

    #217790
    Jennifer Olmo
    Participant

    Thanks for that Sinan –

    I checked out the eval function, and yep like you say I’d have to divide up the curve, but not necessarily at every point. If I divided the curve into 100 blocks, I could add the blocks up for an approximation like: eval(axis1.position1.y,((frame/100)*1)+eval(axis1.position1.y,((frame/100)*2)+eval(axis1.position1.y,((frame/100)*3)+……+eval(axis1.position1.y,((frame/100)*100)

    A stupidly long expression! Perhaps there is a more elegant way to write it? And as the frame number increases, the less accurate it would become, but maybe that’s ok.

    Cheers for the thought!

    #217791
    Jennifer Olmo
    Participant

    @kalthans 27926 wrote:

    i want to thank you both for making my head asplode

    Yeah sorry I know it’s totally over the top – now it’s just become a weird nerdsville mathematical challenge for me…

    #217788
    Shane
    Participant

    Well, I would bake the tw speed curve and paste into another dummy axis and then divide it by another dummy axis so you can change it with out rewriting the expression

    ie:

    1) axis labeled “tw” that has baked tw speed curve
    2) the axis controlling the butter fly in the position y channel put an expression like

    (tw.position.x)+or-?/(tw.position.y)

    use + or – the number on the first frm of tw.position.x to zero out the position and add another axis to repo the butterfly on frm 1

    so if tw curve = 50 – 50 = 0 which would be default position y

    #217789
    shannones riders
    Participant

    I think if integration was possible, it would be included in userfun expression file, just like the speed function which is derivation.
    I had a little time recently and tried to find a better solution, but I failed. Got lost in the jungle of expression loops.
    A ‘for’ cycle could do wonders…:)

    pH.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Copy link
Powered by Social Snap