Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

Bounce y pos at each marker

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Andres TorresBounce y pos at each marker
by on Sep 16, 2012 at 6:37:39 pm

I'm simply trying to write an expression to bounce y position at each marker. My current code produces unnatural results where the position immediately jumps at each marker.

Thanks.

n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
}

if (n == 0){
value;
} else {
freq = 1.0; //oscillations per second
amplitude = 90;
decay = .5;
t = time - marker.key(n).time;

posCos = Math.abs(Math.cos(freq*t*2*Math.PI));
y = amplitude*posCos/Math.exp(decay*t);
position - [0,y]
}


Return to posts index
Reply   Like  

Dan EbbertsRe: Bounce y pos at each marker
by on Sep 16, 2012 at 7:34:54 pm

Just change Math.cos to Math.sin

(Edit) Actually, I'd also change posCos to posSin, just so the variable name would match what it's used for.

Dan



Return to posts index
Reply   Like  

Andres TorresRe: Bounce y pos at each marker
by on Sep 16, 2012 at 8:22:31 pm

Thanks Dan, you're amazing.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]