FORUMS: list search recent posts

aligning emitters to paths

COW Forums : Trapcode

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Kurt Wiley
aligning emitters to paths
on Jun 5, 2006 at 9:03:34 pm

am wondering if there exists an expression that can "align" a sprite layer reasonably well to a path? Right now I am manually keyframing rotation over time to try to align the emitter primary X axis with the path.

I'm comfortable with pickwhipping but not writing expressions (wish there was a really good book out there that described how to write expressions for AE ;-) )



Return to posts index

Mylenium
Re: aligning emitters to paths
on Jun 6, 2006 at 5:06:15 am

No, not really. You'd have to re-construct the entire interpolation. If your object moves at halfway constant speed, you can make AE "look into the future" using the valueAtTime method. This way it can orient itself along the path by looking at its position a few frames ahead. So e.g. if you have position X and Y it would read like:


X_now=position[0];
Y_now=position[1];
X_then=position.valueAtTime(time+1)[0] // current time + 1 second
Y_then=position.valueAtTime(time+1)[1]

diff_X=X_then-X_now; //positional difference
diff_Y=Y_then-Y_now;

angle=radiansToDegrees(Math.atan2(diff_Y,diff_X); //calculate targeting in XY plane

[angle]


as you can see, things can get quite ugly, especially in 3 dimensions. Another option may be using lookAt().


now=position;
then=position.valueAtTime(time+1) // current time + 1 second

angle=lookAt(now,then); //calculate targeting

[angle]


The latter should be applied to orientation rather than rotation since it will calculate all angles at once. It is, however, more prone to flipping since it uses Quarternion rotations. Also none of the above figures in your project structure, so you may need to add references to your layers from the other comp e.g.comp("Trail").layer("Particular")(...).

Mylenium



[Pour Myl


Return to posts index

Kurt Wiley
Re: aligning emitters to paths
on Jun 6, 2006 at 3:57:36 pm

thank you. Any suggestions as to a good text that gives more information about constructing these types of scripts/expressions? The Adobe literature I have found so far has not been that helpful.



Return to posts index


Mylenium
Re: aligning emitters to paths
on Jun 6, 2006 at 8:48:16 pm

No, not really. My guide have always been several books/ websites on Java/ JavaScript along with some shared knowledge from Dan Ebberts and a few other great guys lurking at places like e.g. AEhancers.com . Unfortunately the entire scripting/ expression stuff is very poorly documented so in a way you have to muddle thru until you reach a level you consider usable for your day-to-day needs. Another thing to consider is that a lot of this stuff is just plain, tough math - something I find myself struggling with over and over again, as unbelievable as it may sound.

Mylenium

[Pour Myl


Return to posts index

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