ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Orienting layer based on a vector.

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Wouter Bruneel
Orienting layer based on a vector.
on Nov 21, 2009 at 3:19:26 am

Hello everyone,

Here's what I'm up to. I'm making a stylized tree. All the leaves would be points on a sphere. So i have expression set for their coordinates based on the index of the layer to construct the leaves-sphere. that works well enough for the position of the leaves but i'm having trouble with the orientation. I want the leaves to be perpendicular to the vector from the origin of the sphere to the position point of the leave. I cant use auto-orient to a path since there is no motion path.

Can anyone think of a way to make sure a layer is perpendicular to a given vector?

thanks,

Wouter


Return to posts index

Dan Ebberts
Re: Orienting layer based on a vector.
on Nov 22, 2009 at 12:02:16 am

Depending on how you define the center of your sphere, an orientation expression like this could work:

center = [thisComp.width/2,thisComp.height/2,0];
lookAt(toWorld(anchorPoint),center)


Dan



Return to posts index

Wouter Bruneel
Re: Orienting layer based on a vector.
on Nov 22, 2009 at 12:28:33 am

Thanks dan,

That solved it. I'll have to figure out what it actually does but for now i'm happy to just copy paste it.

thanks again,

Wouter


Return to posts index

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