Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions some expressions help?

  • some expressions help?

    Posted by Guy on May 6, 2005 at 8:38 pm

    I’d have a random wiggle expression:

    seedRandom(13,true);
    wiggle(7,15)

    but would like to get it to decay over time, have the action trail off (in a controllable way)
    Perhaps using some decay code Dan Ebberts was kind enough to provide:

    t = time;
    if (t > 0){
    freq =3;
    amplitude = 50;
    decay = 3.0;

    s = amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

    value + [s,s]
    }else{
    value
    }

    The beauty of this decay is that I can tweak it by changing freq, amplitude, decay values.
    I just don’t know how to put this all together.

    thanks!

    Guy replied 21 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 6, 2005 at 8:50 pm

    Something like this might be what you’re looking for:

    
    initialAmp = 15;
    decay = 3;
    freq = 7;
    decayStartTime = 2;
    
    if (time < decayStartTime){
      amp = initialAmp;
    }else{
      amp = initialAmp/Math.exp(decay*(time - decayStartTime));
    } 
    
    wiggle(freq,amp) 
    
    

    Dan

  • Guy

    May 7, 2005 at 3:56 pm

    exactly! Thanks again Dan.

    check your email…

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