FORUMS: list search recent posts

# Rotate a layer to be perpendicular to a path?

FAQ   •   VIEW ALL
 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!

 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?

 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?

 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);

Dan

 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!