FORUMS: list search recent posts

Rotate a layer to be perpendicular to a path?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Riccardo Sinti
Rotate a layer to be perpendicular to a path?
on Jul 26, 2013 at 4:45:14 pm

I've got some layers (people) I've linked to a path through an expression so that i can use a slider to position them along the shape of the path but I can't auto orient them to the path so that they are always standing on the path perpendicular to it.

Is there an expression that can orient a layer to be perpendicular to a path? Tangents maybe?

Big thanks as always to the brilliant minds in this forum!


Return to posts index

Dan Ebberts
Re: Rotate a layer to be perpendicular to a path?
on Jul 26, 2013 at 5:27:32 pm

What's the expression you're using to determine the layer's position?



Return to posts index

Riccardo Sinti
Re: Rotate a layer to be perpendicular to a path?
on Jul 26, 2013 at 5:43:14 pm

I've got a pre-comp with the path I'm referencing then on the position of the layers that are aligned on the path I have this expression:

PathPercent=effect("Path Percent")("Slider");
PathLength=comp("PATH").duration;
PathCalc=(PathLength*PathPercent)/100;
PathPos = comp("PATH").layer("PATH").position.valueAtTime(PathCalc);

then on the "Path Percent" "Slider" I have this to control spacing and offset along the path

f = index*thisComp.layer("OFFSET").effect("FACTOR")("Slider");
f + thisComp.layer("OFFSET").effect("OFFSET")("Slider");

So this rig has allowed me to position the people on the perimeter of my logo shape (which is defined by the PATH) and control the space between them with the FACTOR.

Does that make sense?


Return to posts index


Dan Ebberts
Re: Rotate a layer to be perpendicular to a path?
on Jul 26, 2013 at 5:48:35 pm

Try this for rotation (not tested, but should be close):

PathPercent=effect("Path Percent")("Slider");
PathLength=comp("PATH").duration;
PathCalc=(PathLength*PathPercent)/100;
v = comp("PATH").layer("PATH").position.velocityAtTime(PathCalc);
radiansToDegrees(Math.atan2(v[1],v[0]))


Dan



Return to posts index

Riccardo Sinti
Re: Rotate a layer to be perpendicular to a path?
on Jul 26, 2013 at 6:06:12 pm

PERFECT!

You are the best!

Thanks so much!


Return to posts index

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