ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Getting rotation value between two position values

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mikkell khan
Getting rotation value between two position values
on Jun 4, 2010 at 11:06:02 pm

I need an expression to get the rotation from two position values or to extrapolate the rotation from two position values. Eg. Ramp effect which has two points does not have a value for the rotation between these two points. There is a problem because I have an object that requires the need of such a value.

The ramp is being used as an artificial sky and the object in question are clouds in the sky. I need to parent the cloud onto the sky but the footage has no points to track and the cinematography has a lot of rotation. The ramp is already animated to match that rotation.


Return to posts index

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



Return to posts index

Fud Hodgkinson
Re: Getting rotation value between two position values
on Sep 29, 2019 at 6:30:07 am

Hi there! WOuld you have any idea of how to get this expression to work for 3D space between two 3d nulls?

I did a screencap of my problem here:






The position works perfectly however I can't get the rotational value between two 3d nulls.

Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]