ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Constant speed taking account change of direction (velocity)

FAQ   •   VIEW ALL
 Constant speed taking account change of direction (velocity) on Sep 3, 2018 at 7:38:12 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:

and a screen shot:

 Re: Constant speed taking account change of direction (velocity)on Sep 3, 2018 at 8:39:33 pm

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

Dan

 Re: Constant speed taking account change of direction (velocity)on Sep 3, 2018 at 11:29:27 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: http://mindfury.com/?p=420

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