Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Constant speed taking account change of direction (velocity)

  • Constant speed taking account change of direction (velocity)

    Posted by Frederic Antoinette on September 3, 2018 at 7:38 pm

    I’ve always had that problem, even though I use rove across time, if a layer rotate, either by auto orient or manually at those rotation point it accelerates due to the change of direction, and is visually not pleasing.
    My solution to this is to add antoher position keyframe at the middle rotation points and play with the position velocity to try and keep it steady.
    Would there be an expression that can look into the direction change and slow down or accelerate the position speed so it seems more fluid?

    To better understand here is an example.
    The arrow travel along that path with auto orient, when it turns you have the impression it is accelerating.
    The first segment I have added a keyframe and tweaked the velocity to get it to slow down during the rotation.

    a little video:
    Click here to view a little preview of what I mean

    and a screen shot:

    Frederic Antoinette replied 8 years ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    September 3, 2018 at 8:39 pm

    What happens if you just put the anchor point at the tip of the arrow?

    Dan

  • Frederic Antoinette

    September 3, 2018 at 11:29 pm

    It has the opposite effect, it seems to slow down at the turns…

    And with the length of the arrow, not really pretty at all; kind of look like its wagging its tail…
    However I found this:
    cornerEase = 3;
    p = transform.position;
    t = Math.min(Math.max(time,p.key(1).time+.001),p.key(p.numKeys).time);
    pre = position.valueAtTime(t-thisComp.frameDuration*cornerEase);
    post = position.valueAtTime(t+thisComp.frameDuration*cornerEase);
    delta = post-pre;
    orient = radiansToDegrees(Math.atan2(delta[0],-delta[1]));
    value+orient

    there: https://mindfury.com/?p=420

    tweaking the cornerEase I was able to get what I wanted this time.

  • Frederic Antoinette

    September 3, 2018 at 11:31 pm

    Forgot to mentioned that used that code as an alternative for auto orient. In the rotation.

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