Page 1 of 1

Time question

Posted: June 17th, 2007, 12:08 am
by detomaso
hello guys,
I often use one of the floowing Dan Ebbert script,

freq = 1.0; //oscillations per second
amplitude = 50;
decay = 0.7;

amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time)

but my problem is, how do i control this in time. If i apply this to the rotation property it seems always to begin since the beginning of the comp no matter what i try. What if i want this effects to begin after, 5 seconds for exemple.
Is there some code to add ? or something to tune ?

Thanks for your sharing your knowledge

detomaso

Posted: June 17th, 2007, 5:36 pm
by Dan Ebberts
Sure, like this:

freq = 1.0; //oscillations per second
amplitude = 50;
decay = 0.7;
timeToStart = 5; // start time (seconds)

t = Math.max( time - timeToStart,0);
amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t)


Dan

Posted: June 18th, 2007, 12:45 am
by detomaso
Dan Ebberts wrote:Sure, like this:

freq = 1.0; //oscillations per second
amplitude = 50;
decay = 0.7;
timeToStart = 5; // start time (seconds)

t = Math.max( time - timeToStart,0);
amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t)


Dan
Thanks a lot Dan.
Works perfect