Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create rotation bounce?

  • Create rotation bounce?

    Posted by Brent Pierce on January 24, 2011 at 10:30 pm

    I’m trying to recreate the Kayak.com bumper. They have a flip board with cards that fall down. When the cards fall, they don’t swing all the way through (like a pendulum). Instead, they bounce off of the vertical plane and then come to rest after a decay. I’ve played with the bounce expressions, but can’t get it to work inside the X-rotation parameter.

    I’ve cut the cards in half and made them 3D. Now I’m stuck with this expression. Any help would be awesome.

    Here’s the video with the bumper at the end which I’m trying to recreate.
    https://youtu.be/jj67ED3TzbE?hd=1

    Thanks!

    -Brent

    “For I know the plans I have for you,” declares the Lord, “plans to prosper you and not to harm you, plans to give you hope and a future.”
    -Jeremiah 29:11

    Kevin Camp replied 15 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    January 25, 2011 at 6:27 pm

    the trick to get it to not swing through is to use Math.abs() to return only positive values so it will look like it bounces off something solid, rather than a free swing…

    this is an expression i use for hard bounces. it does assume only two keyframes for the animation.. if there are more, the bounce will only happen after the last key.

    k = .05; // spring constant
    d = 10; // damping constant
    freq = 4; // oscillation frequency

    if (numKeys > 1){
    if (time >= key(numKeys).time + (thisComp.frameDuration)){
    t0 = key(numKeys).time;
    t = time - t0;
    v = velocityAtTime(t0)*(k*-Math.abs(Math.cos(freq * t * Math.PI * 2))/Math.exp(t*d));
    valueAtTime(t0) + v;
    }else{
    value;
    }
    }else{
    value;
    }

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    January 25, 2011 at 7:03 pm

    forgot an else statement…

    try this:

    k = .05; // spring constant
    d = 10; // damping constant
    freq = 4; // oscillation frequency

    if (numKeys > 1){
    if (time >= key(numKeys).time + (thisComp.frameDuration)){
    t0 = key(numKeys).time;
    t = time - t0;
    v = velocityAtTime(t0)*(k*-Math.abs(Math.cos(freq * t * Math.PI * 2))/Math.exp(t*d));
    valueAtTime(t0) + v;
    }else{
    value;
    }
    }else{
    value;
    }

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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