SIGN IN
::
SPONSORS
::
ADVERTISING
::
ABOUT US
::
CONTACT US
FORUMS
TUTORIALS
MAGAZINE
STOCKYARD
VIDEOS
PODCASTS
EVENTS
SERVICES
NEWSLETTER
NEWS
BLOGS
ADOBE AFTER EFFECTS:
Home
Forum
Basics
Expressions
Tutorials
Podcasts
AE Techniques
Training
Creative Cloud Debate
FAQ
Am I doing this right?
COW Forums
:
Adobe After Effects Expressions
FAQ
•
VIEW ALL
•
ADD A NEW POST
•
PRINT
Respond to this post
•
Return to posts index
•
Read entire thread
Am I doing this right?
by
Conrad Olson
on Nov 30, 2006 at 12:52:40 pm
I am trying to teach myself how to use expressions (with a lot of help from this forum I should add).
One thing I've needed to do several times in my projects is to work out the direction that something is traveling at any point in time so I can adjust and other property or object accordingly. In the case bellow I have set up a particle emitter to move around the screen and I wanted the angle of the emitter to change so that it looks like the tail of a firework or something. I haven't come across a straight forward way of doing this so I've done the following:
old_pos=effect("Particle Playground")("Position").valueAtTime(time-0.2);
new_pos=effect("Particle Playground")("Position");
y_was=old_pos[1];
x_was=old_pos[0];
y_is=new_pos[1];
x_is=new_pos[0];
y_dif=(y_was-y_is);
x_dif=(x_was-x_is);
angle=Math.atan2(y_dif, x_dif);
deg_angle=radiansToDegrees(angle);
[deg_angle+90];
This works well but is it the simplest way of doing this or is there an easier way?
Thanks
Conrad
Posts Index
Read Thread
Reply
Like
Current Message Thread:
Am I doing this right?
by Conrad Olson on Nov 30, 2006 at 12:52:40 pm
Re: Am I doing this right?
by Mylenium on Nov 30, 2006 at 1:07:18 pm
Re: Am I doing this right?
by Conrad Olson on Nov 30, 2006 at 2:18:29 pm
Re: Am I doing this right?
by Mylenium on Nov 30, 2006 at 5:37:56 pm
Re: Am I doing this right?
by Dan Ebberts on Nov 30, 2006 at 7:16:35 pm
Re: Am I doing this right?
by Conrad Olson on Dec 4, 2006 at 2:44:25 pm
Re: Am I doing this right?
by Conrad Olson on Dec 4, 2006 at 3:00:44 pm
LOGIN TO REPLY
FORUMS
•
TUTORIALS
•
MAGAZINE
•
STOCKYARD
•
VIDEOS
•
PODCASTS
•
EVENTS
•
SERVICES
•
NEWSLETTER
•
NEWS
•
BLOGS
© 2013
CreativeCOW.net
All rights are reserved. -
Privacy Policy
[
Top
]