Home Page › forums › fx Art and Technique › Expressions for VFX › An "Integrating" expression for Flame?
- This topic has 6 replies, 6 voices, and was last updated 10 years, 8 months ago by Jennifer Olmo.
-
AuthorPosts
-
April 13, 2009 at 3:20 am #202822c64Participant
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,
MikeApril 13, 2009 at 3:02 pm #217786AnonymousInactiveHmmm,
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
April 13, 2009 at 11:46 pm #217787KjellParticipanti want to thank you both for making my head asplode
April 14, 2009 at 12:27 am #217790Jennifer OlmoParticipantThanks 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!
April 14, 2009 at 12:30 am #217791Jennifer OlmoParticipant@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…
April 14, 2009 at 3:29 am #217788ShaneParticipantWell, 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
February 15, 2010 at 9:43 am #217789shannones ridersParticipantI 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.
-
AuthorPosts
- You must be logged in to reply to this topic.
