Time question

Moderators: Disciple, zlovatt

Post Reply
detomaso
Posts: 5
Joined: May 31st, 2007, 1:45 pm

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
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

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
detomaso
Posts: 5
Joined: May 31st, 2007, 1:45 pm

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
Post Reply