Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions expression to emulate a bobber floating in water

  • Bryan Woods

    April 1, 2013 at 7:29 pm

    So, 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 pm

    yea 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 pm

    wiggle() might get you closer to what you want:

    wiggle(1,20)

    Dan

  • Tylor Larson

    April 1, 2013 at 10:05 pm

    that 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 pm

    You 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 pm

    SWEET!!! 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 pm

    SWEET!!! 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 pm

    There 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

  • Tylor Larson

    April 5, 2013 at 1:25 pm

    sweet that did the trick. i cant thank you enough!

    Ty

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy