Forum Replies Created

  • Kenji Takahashi

    June 30, 2020 at 1:42 pm in reply to: Continuous bounce

    Yeah this one is cleaner.

    I was actually looking for solution to do this.

    I call it inertial animation. (or Ice animation ☺ )
    Basically with the tweak in frequency and decay I can make inertia in movement without null parenting, with fever keyframes and without tweaks to keyframe velocity.
    Example above was done with the code below and just easing first keyframe of movement. (animation must be done in linear fashion, forward, keyframe by keyframe. Just like pushing hockey puck on ice)

    Once again thanks Dan!

    freq = 0.001;
    decay = 0.6;
    val = value
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n > 1){
    w = freq*Math.PI*2;
    for (i = 2; i <= n; i++){
    t = time - key(i).time;
    if (t > 10/decay) continue;
    amp = velocityAtTime(key(i).time - .001);
    val += amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    }
    }
    val

  • Kenji Takahashi

    June 30, 2020 at 11:33 am in reply to: Continuous bounce

    Absolutely beautiful, thank you Dan,
    you sir are a gentleman and a scholar!

    It will take hours to see what you did there 🙂

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