Activity › Forums › Adobe After Effects Expressions › Velocity-based rotation?
-
Velocity-based rotation?
Posted by Navarro Parker on October 10, 2012 at 12:22 amIs there any way to base layer’s rotation on another layer’s velocity? The faster a layer moves, the more the other layer rotates.
Navarro Parker replied 13 years, 11 months ago 3 Members · 3 Replies -
3 Replies
-
Kevin Camp
October 10, 2012 at 2:04 amyep… pretty much any key framed property will have velocity or speed, so an expression like this could be used to link one layer’s velocity to another’s rotation:
L = thisComp.layer(“square”); // this is your square layer, or layer to take velocity from
L.transform.position.velocity[0]/50;the expression looks only at x position, to look at y, change [0] to [1]; or z, change to [2].
the 50 can be changed to any value to get the amount of rotation you need, 50 was kind of arbitrary on my end
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Dan Ebberts
October 10, 2012 at 2:16 amI think this is what you’re asking for, but I doubt that it’s really what you want:
factor = 50;
vx = -thisComp.layer(“leader”).transform.position.velocity[0];
vx/factorMy guess is that you’re really looking for a more complex simulation that is based on acceleration, inertia, and overshoot.
Dan
-
Navarro Parker
October 10, 2012 at 6:50 pmThat works amazingly well. But you’re right, I would like to soften out the rotation a bit. Would adding overshoot and dampening be overly complicated?
(If this was Cinema 4D, I’d just throw on a Delay effector!)
Reply to this Discussion! Login or Sign Up
