ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Champagne Bubble random path and rotation to set end position

FAQ   •   VIEW ALL
 Champagne Bubble random path and rotation to set end position on Oct 26, 2018 at 3:37:48 pm

I'm going crazy trying to figure out the right expression to use with this, but what I'm looking to do is have a plethora of shapes (stars to be exact) to float in from the bottom to the top like bubbles in a champagne glass that randomly sway back and forth while floating up to a set end point. I've found various expressions here and elsewhere, but none really hit what I'm looking to do. I've tried wiggles and other expressions, but I just don't think I'm skilled enough to really figure it out on my own. Does anyway have any insights they could lend to at least point me in the right direction? Thanks!

-Ryan
http://www.leewayfilms.com

 Re: Champagne Bubble random path and rotation to set end positionon Oct 26, 2018 at 4:29:21 pm

minWobble = 10;
maxWobble = 25;
minFreq = 1;
maxFreq = 2;
minRise = 100;
maxRise = 150;

seedRandom(index,true);
wobble = random(minWobble,maxWobble);
freq = random(minFreq,maxFreq);
rise = random(minRise,maxRise);
phase = random(Math.PI*2);
t = time - inPoint;
y = -t*rise;
x = wobble*Math.sin(t*freq*Math.PI*2+phase);
value + [x,y]

Dan

 Re: Champagne Bubble random path and rotation to set end positionon Oct 26, 2018 at 4:35:45 pm

Thanks Dan. Where in here would I set the end point so it stops?

-Ryan
http://www.leewayfilms.com

 Re: Champagne Bubble random path and rotation to set end positionon Oct 26, 2018 at 5:46:56 pm

It would depend on how you have things set up. I just wanted to show you a technique I've used to generate bubble motion.

Dan