Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

controlling rate and stop time with slider

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
controlling rate and stop time with slider
by Bert Brown on May 18, 2009 at 7:25:15 pm

posing my question again, hopefully simpler this time:

what's the best way to have an object always moving in one direction where it's speed can modified by a slider that allows it to stop?

right now i've got position X = time*rate, where rate is the slider, but it causes it to move backwards when i try to stop it.

----------------------------------


peep my over-the-interweb band, red abbott.
"we electro-rock over long distances..."

Respond to this post   •   Return to posts index


Re: controlling rate and stop time with slider
by Dan Ebberts on May 18, 2009 at 8:09:53 pm

The only way I know of is to do a frame-by-frame integration of the rate multiplied by the frame duration. Something like this:

rate = effect("Slider Control")("Slider");
f = timeToFrames();
accum = 0;
for (i = 1; i <= f; i++){
accum += rate.valueAtTime(framesToTime(i))*thisComp.frameDuration;
}
value + [accum,0]


Dan



Respond to this post   •   Return to posts index

Re: controlling rate and stop time with slider
by Bert Brown on May 19, 2009 at 7:33:57 pm

thanks, dan. this works, but it appears to be giving me little flickers of movement (not smooth). i got similar results even in just doing a time*rate or timeToFrames(time)*rate situation. any thoughts?

----------------------------------


peep my over-the-interweb band, red abbott.
"we electro-rock over long distances..."

Respond to this post   •   Return to posts index



Re: controlling rate and stop time with slider
by Bert Brown on May 19, 2009 at 9:22:13 pm

nevermind, that seemed to just be this computer being on for days.

thanks again

----------------------------------


peep my over-the-interweb band, red abbott.
"we electro-rock over long distances..."

Respond to this post   •   Return to posts index


<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]