Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Bobbing in Water REDUX REDUX

  • Bobbing in Water REDUX REDUX

    Posted by David Rodriguez on June 23, 2008 at 3:16 pm

    The expressions I am using..
    on position

    xAmp = 3; //height of undulations (pixels)
    xFreq = .3; //undulations per second
    xSpeed = 150; //speed of wave (pixels per second)

    wl = xSpeed/xFreq; //wavelength (pixels)
    phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
    y = xAmp*Math.sin(2*Math.PI*xFreq*time + phaseOffset);

    //–NEW

    swayAmp = 100; //amplitude of sway
    swayFreq = .25; //frequency of sway
    x = swayAmp * Math.sin(time * swayFreq);

    //—–
    value + [x,y]

    on rotation

    xFreq = .3; //undulations per second
    xSpeed = 150; //speed of wave (pixels per second)
    damping = 15; //undulation damping factor

    wl = xSpeed/xFreq; //wavelength (pixels)
    phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
    theta = Math.atan(Math.cos(2*Math.PI*xFreq*time + phaseOffset));
    radiansToDegrees(theta)/damping;

    Is there any way to make the upward motion be faster than the downward motion? Say 50% faster?

    Any help is much appreciated.

    Kevin Camp replied 17 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    June 23, 2008 at 3:22 pm

    try changing swayFrq to:

    swayFreq = xFreq * 2;

    that should link the timing of your vertical movement to your horizontal movement, but make the hozizontal undulation frequency 2x as long…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • David Rodriguez

    June 23, 2008 at 3:39 pm

    Thanks Kevin, but what I am trying to do is have the downward motion of the object take twice as long as the upward motion.
    I need my object to siiiiiink down and then POP upwards as well as rotate and sway as it is now.

  • Kevin Camp

    June 23, 2008 at 3:43 pm

    sorry, i misunderstood (or misread)…

    replace swayFreq with this:

    swayFreq = xFreq / 2;

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    June 23, 2008 at 3:45 pm

    scrap that.

    i totally misread your post… i understand what you are looking for now. let me think about this for while…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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