Activity › Forums › Adobe After Effects Expressions › expression to emulate a bobber floating in water
-
expression to emulate a bobber floating in water
Posted by Tylor Larson on April 1, 2013 at 6:44 pmI need an expression to emulate a bobber floating in water, rocking and moving. here is a link to the and images that shows the angle my camera is at.
https://fc00.deviantart.net/fs13/f/2007/051/f/8/Water_Texture_by_SimplyBackgrounds.jpg
I’m using the expression inside the element plug in. I can i just cant figure out what, or where i should put in for and expression.
Tylor Larson replied 13 years, 3 months ago 3 Members · 9 Replies -
9 Replies
-
Bryan Woods
April 1, 2013 at 7:29 pmSo, are you looking down at the water from above? Thats what your linked image appears to be.
If so, I would use this expression to oscillate the scale of the layer. You could also apply it to rotation and modify it a bit to get that subtle rocking.
amp = 100;
freq = 1;
s = amp*Math.sin(time*freq*Math.PI*2);
value + [s]
-
Tylor Larson
April 1, 2013 at 7:49 pmyea the camera is pointing down at the water directly from above.
This kind of works… the only issue I’m having is that it simple rocks back and forth in the same way… which im guessing is because of the sin wave… is there any way to make this rock a little more naturally?
-
Dan Ebberts
April 1, 2013 at 9:35 pmwiggle() might get you closer to what you want:
wiggle(1,20)
Dan
-
Tylor Larson
April 1, 2013 at 10:05 pmthat is funny…originally I had that in place but, i need it to ease into a value and then pick up speed coming out of that value…
https://www.youtube.com/watch?v=s1By341ulxs
… note how the buoy rocks back and forth. maybe Im over thinking this.
Some contents or functionalities here are not available due to your cookie preferences!This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.
-
Dan Ebberts
April 1, 2013 at 10:36 pmYou might play around with a combination of the sine wave and a wiggle of a different frequency for a bit of chaos:
amp1 = 15;
amp2 = 12;
freq1 = 1.5;
freq2 = 1;
wiggle(freq1,amp1) + amp2*Math.sin(time*freq2*Math.PI*2)Dan
-
Tylor Larson
April 4, 2013 at 10:29 pmSWEET!!! that is what i was looking for… i really need to get around to sitting down and studying your website. just been so busy.. thanks again …
-
Tylor Larson
April 4, 2013 at 10:49 pmSWEET!!! that is what i was looking for…
one last issue. I’m using this on a script on a piece of ice that starts out as a sheet of ice and then shatters into pieces and floats away. so i need to be able to keyframe the expression to go from no moment to moving. i was wiring the variables to sliders but then remembered that the sin.math is still producing a value. any ideas?
i really need to get around to studying your website. just been so busy.. thanks again … you are the script master
-
Dan Ebberts
April 4, 2013 at 11:15 pmThere are a number of ways to do it, but this example should give you the idea. Starting at 5 seconds, it will ease into the motion over a 3-second period:
tStart = 5;
easeDur = 3;
amp1 = 15;
amp2 = 12;
freq1 = 1.5;
freq2 = 1;
val = wiggle(freq1,amp1) + amp2*Math.sin(time*freq2*Math.PI*2);
ease(time,tStart,tStart+easeDur,value,val)Dan
Reply to this Discussion! Login or Sign Up