ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Getting rotation value between two position values

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan Ebberts
Re: Getting rotation value between two position values
on Jun 4, 2010 at 11:39:05 pm

Assuming that you're talking about 2D, this may be close to what you're looking for:

L1 = thisComp.layer("Layer 1");
L2 = thisComp.layer("Layer 2");
p1 = L1.toWorld(L1.anchorPoint);
p2 = L2.toWorld(L2.anchorPoint);
delta = p2 - p1;
radiansToDegrees(Math.atan2(delta[1],delta[0]));


Dan



Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]