Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Alessandro Lucchini on May 9, 2011 at 10:18 am

    Hi all.
    I stumbled this video: https://www.youtube.com/watch?v=yVkdfJ9PkRQ
    i was trying to recreate something like that using expressions.

    In brief: i need to have a series of pendulums swinging at a given frequncy (f) (let’s say 15 pendulums swinging each at a frequency from 51 to 65 oscillations per minute), and I need that the lenght of every pendulum’s arm depends on the frequency.

    I’m not that good with expressions or with physics, so that is what I came out with, incomplete and not working:
    I create a round shape with a masked solid, let’s say 60 pixels wide, and i wrote the following expressions for rotation and anchor point:

    Do my expressions make any sense?
    How would you make it?
    thanks.

    Alessandro

    anchor point:

    f= effect("oscillations per minute")("Slider")/60;
    T= 1/f;
    g= effect("gravity")("Slider");
    L= (T*T*g)/((4*Math.PI)*(4*Math.PI));

    anchorPoint[0],(anchorPoint[1]-L)]

    rotation:

    f= effect("oscillations per minute")("Slider");
    T= 1/f;
    g= effect("gravity")("Slider");
    L= (T*T*g)/(4*(Math.PI*Math.PI));
    maxAmp=effect("maxAmp")("Slider");

    Math.cos((time/T))*maxAmp

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Alessandro Lucchini replied 15 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 9, 2011 at 5:29 pm

    I think I’d leave gravity out of it. I used small circles (20×20 solids), and this seems to work:

    // anchor Point

    shortLen = 100;
    longLen = 300;
    numPendulums = 15;

    myLen = linear(index,1,numPendulums,shortLen,longLen);
    value – [0,myLen]

    // rotation

    shortLen = 100;
    longLen = 300;
    numPendulums = 15;

    freq = .2; // frequencey of longest pendulum
    amp = 80;

    myLen = linear(index,1,numPendulums,shortLen,longLen);
    myFreq = (longLen/myLen)*freq;
    amp*Math.cos(myFreq*time*Math.PI*2)

    Of course, you could tie any/all of the parameters to sliders. The expressions assume that the pendulums are at the top of the layer stack.

    Dan

  • Dan Ebberts

    May 9, 2011 at 6:31 pm

    Oops, I forgot about the square root relationship between the length and the period. The rotation expression should probably be more like this:

    // rotation

    shortLen = 100;
    longLen = 300;
    numPendulums = 15;

    freq = .2; // frequencey of longest pendulum
    amp = 80;

    myLen = linear(index,1,numPendulums,shortLen,longLen);
    myFreq = Math.sqrt(longLen/myLen)*freq;
    amp*Math.cos(myFreq*time*Math.PI*2)

    Dan

  • Alessandro Lucchini

    May 9, 2011 at 7:29 pm

    brilliant.
    Thank you so much.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy