Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Swinging down and decaying to a stop

  • Swinging down and decaying to a stop

    Posted by Graham Hutchins on December 15, 2008 at 8:00 pm
    startFrame = 14
    
    if (time >= framesToTime(startFrame)){ 
    freq =1.0;
    amplitude = 50
    decay = 1.5;
    amplitude*Math.sin(freq*2*Math.PI)/Math.exp(decay)
    }else{
    value}

    Hello all,

    I have the basic mechanics for a rotation decay set up, but I need the starting position of the decay to be different from the end position.

    Imagine a pendulum that’s sticking straight out to the left, perpendicular to the ground. I need the pendulum to swing down and decay to a stop, with the pendulum resting, pointing to the ground. I’m trying to knock a windmill off it’s tower and I want the blades to swing down and decay before it drops off. It’s starting rotation is zero, but the blades element points left perpendicular to the ground, so in that respect, the actual starting rotation of the element isn’t exactly like a pendulum, but would have the same effect.

    The expression I’m using gets the decay right, but it jumps from 0 degrees to about 10.5 before decaying and I have no idea how to get it to swing from the starting point I want.

    Thanks in advance for your help.

    -Graham

    OSX 10.4.11
    AE CS3 and 7.0
    FC Studio 2.03
    Dual 2.7GB PPC G5, 8 GB RAM

    Graham Hutchins replied 17 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 15, 2008 at 9:31 pm

    It’s probably going to look like this:

    startFrame = 14

    if (time >= framesToTime(startFrame)){
    t = time – framesToTime(startFrame);
    freq =1.0;
    amplitude = 90
    decay = 1.5;
    amplitude*Math.cos(t*freq*2*Math.PI)/Math.exp(t*decay)
    }else{
    value
    }

    Dan

  • Graham Hutchins

    December 15, 2008 at 9:52 pm

    Nailed it.

    I did need to subtract 90 from “amplitude*Math.cos(t*freq*2*Math.PI)/Math.exp(t*decay)” to get the element oriented correctly, but otherwise, spot on.

    Many thanks.

    -Graham

    OSX 10.4.11
    AE CS3 and 7.0
    FC Studio 2.03
    Dual 2.7GB PPC G5, 8 GB RAM

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