Discussion:
Making pendulum stop at certain time?
(too old to reply)
D***@adobeforums.com
2008-07-10 21:46:58 UTC
Permalink
Try this:

veloc = 7;
amplitude = 80;
decay = 2.0;

t = (time - inPoint);
if (t < 0){ value }else{ amplitude*Math.sin(veloc*t)/Math.exp(decay*t) }

You can use the graph editor to see the effect of changing the parameters, so you can get it set up the way you want.

Dan
N***@adobeforums.com
2008-07-10 22:07:05 UTC
Permalink
Works beautifully Dan! Thank you!

I notice that the pendulum always starts at the rest position. Is there a way to start it at the highest point?
D***@adobeforums.com
2008-07-10 22:09:27 UTC
Permalink
Just change Math.sin() to Math.cos()

Dan
N***@adobeforums.com
2008-07-14 16:21:15 UTC
Permalink
Hey, it works! You're a genius as always!
N***@adobeforums.com
2008-07-13 21:31:38 UTC
Permalink
Cosine! Of course! Thank you!

How would you apply the inPoint to your Jack-in-the-Box expression?

veloc = effect("Velocity")("Slider");
amplitude = effect("amp")("Slider");
decay = effect("Decay")("Slider");
y = amplitude*Math.sin(veloc*time)/Math.exp(decay*time);
value + [0,y]
D***@adobeforums.com
2008-07-13 22:43:19 UTC
Permalink
Like this, probably (not tested):

veloc = effect("Velocity")("Slider");
amplitude = effect("amp")("Slider");
decay = effect("Decay")("Slider");
t = time - inPoint;
y = amplitude*Math.sin(veloc*t)/Math.exp(decay*t);
value + [0,y]

Loading...