Activity › Forums › Adobe After Effects Expressions › Angle Measure expression
-
Josh Coleman
May 26, 2013 at 10:11 pmAha, that’s what i was doing!
I was using the rotate option in the layers down the bottom rather than adjusting the starting and end points of the beam itself.
Thank you very much, this will help me a lot!
-
Dan Ebberts
May 26, 2013 at 10:19 pmThis should work if the layers are rotated:
L1 = thisComp.layer(“Beam Layer 1”);
L2 = thisComp.layer(“Beam Layer 2”);
beam1 = L1.effect(“Beam”);
beam2 = L2.effect(“Beam”);
v1 = L1.toWorldVec(beam1(“Ending Point”) – beam1(“Starting Point”));
v2 = L2.toWorldVec(beam2(“Ending Point”) – beam2(“Starting Point”));
radiansToDegrees(Math.acos(dot(normalize(v1),normalize(v2))))Dan
-
Josh Coleman
May 26, 2013 at 10:45 pmMarvelous!
I was just about to come back with a problem where the number wont change as the video goes on because the beams are parented to the Null which changes scale/position/rotation but not start and end points.
Is there, by any chance, a simple way for the output to be to fewer decimal places? If not it’s ok as is.
Thank you once again!
-
Dan Ebberts
May 26, 2013 at 11:13 pmJust change the last line to this:
a = radiansToDegrees(Math.acos(dot(normalize(v1),normalize(v2))))
a.toFixed(2)Dan
Reply to this Discussion! Login or Sign Up