FORUMS: list search recent posts

animating arrows with expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tine Lenart
animating arrows with expressions
on Sep 26, 2012 at 6:37:19 pm

Hello there!

I am working on a video project about car driving and I have to add a animation about forces on the tire. I have to demonstrate how the forces work when the car's tire turn left or right (this force is demonstrated on x axis). When the car accelerates or breaks (this force comes to y axis). On top of that, I want to add a third animated arrow, which is the result of the x and y axis. I would like the arrow to have a constant size head, only want to change the length of the body. Anyone can help me please?


Return to posts index

Dan Ebberts
Re: animating arrows with expressions
on Sep 26, 2012 at 9:49:44 pm

It's hard to know exactly what you need (so much depends on the details of your project), but the magnitude of the rsulting force will be:

xyForce = Math.sqrt(xForce*xForce + yForce*yForce)

and the angle will be:

radiansToDegrees(Math.atan2(yForce,xForce)

If you wanted to scale the width of the arrow body based based on the xyForce value, you'd have to pick a force that equates to 100% scale and then you end up with an expression like this:

force100 = 500;
[value[0]*xyForce/force100,value[1]

Of course the scale expression would need the xyForce value, so you'd either have to calculate that in a slider or duplicate the calculation in the scale expression.

That's probably not much help, but maybe it will get you headed in the right direction.


Dan



Return to posts index

Tine Lenart
Re: animating arrows with expressions
on Oct 1, 2012 at 10:30:51 pm

Hello Dan!

I found your code very useful! As I was new to expressions, I had to read a few tutorials and use some of your code. It works very well and I use the dynamic link with my after effects composition, so I can change the value of the x and y force on two sliders.
Thank you!


Return to posts index

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