Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Looping a sine expression within a 10 sec animation

  • Looping a sine expression within a 10 sec animation

    Posted by Nina Frost on July 12, 2018 at 6:08 am

    Hi All,

    I am trying to loop a sine expression within a 10sec frame so that when playback the sine wave is seamless.
    What i did was this

    Create a layer under Trapcode Particular
    under Emitter>Position XY the expression is

    xPos = 2800;
    freq=0.15;
    amp=random(50,100);
    y = amp*Math.sin(freq*time*Math.PI*2);
    yPos = y+360;
    [xPos,yPos]

    See my sample here. https://youtu.be/H5H3KmGJk1w

    Need some guidance on how to write the sine expression to loop whilst holding the same wave height/length and frequency ?

    Please help!

    Thanks!
    Nina

    xPos = 2800;
    freq=0.15;
    amp=random(50,100);
    y = amp*Math.sin(freq*time*Math.PI*2);
    yPos = y+360;
    [xPos,yPos]

    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.

    Nina Frost replied 7 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 12, 2018 at 6:15 am

    Since your frequency is 0.15, after 10 seconds it will have completed 1.5 cycles, which won’t loop correctly. It would work if your frequency were 0.1 or 0.2, but I don’t know if either of those will work for you.

    Dan

  • Nina Frost

    July 12, 2018 at 6:31 am

    Thanks Dan,

    I have amended the expression to the following

    xPos = 2800;
    freq=0.1;
    amp=random(50,100)
    y = amp*Math.sin(freq*time*Math.PI*2);
    yPos = y+360;
    [xPos,yPos]

    However it seems that there’s still a tinee misalignment with the particles.

    Please see attached.
    https://youtu.be/5ic20GANxRs

    I checked my other settings and think i have accurately set all other keyframes to loop at the same value start and end.



    Can u assist to correct me where i went wrong?

    Thanks!
    Nina

    xPos = 2800;
    freq=0.1;
    amp=random(50,100)
    y = amp*Math.sin(freq*time*Math.PI*2);
    yPos = y+360;
    [xPos,yPos]

    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.

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