Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions and sine waves

Tagged: 

  • Expressions and sine waves

    Posted by John Baylock on August 24, 2021 at 1:14 pm

    Hi,

    I created a simple AE animation using the “write-on” effect.

    In the “position argument” of the effect, I wrote this expression:

    freq=5.5;

    amp=100;

    veloc=192;

    x=time*veloc;

    y=amp*Math.sin(time*freq*Math.PI)+thisComp.height/2;

    [x,y]

     

    This will progressively draw a sine wave from left to right until it fills the screen horizontally after 10 seconds. Although the drawing is progressive, the wave itself is static as each crest and trough remains at its position. The only thing that is dynamic is the drawing.

    <font face=”inherit”>The thing is that I want is the other way around</font>:

    <font face=”inherit”>I would like to have the exact same sine wav but drawn all at once since the very first frame and then see it move from right to left, infinitely. </font>So the wave is always filling the screen horizontally but the crests and troughs should be moving from right to left.

    <font face=”inherit”>The same way one would look straight ahead and watch a infinite train passing by </font>perpendicularly,<font face=”inherit”> from right to left</font>

     

    I searched the internet for quite a while and don’t see anything that would help me do that.

    Any help would be appreciated.

     

    John Baylock replied 4 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Walter Soyka

    August 24, 2021 at 2:47 pm

    Once you’ve drawn the sine wave, you can animate the Offset effect to make it move.

  • John Baylock

    August 25, 2021 at 2:52 am

    “Once you’ve drawn…”.

    Well, that was my question: how to draw it all at once….

    My problem is solved since I eventually found out how to use an array of values that I plot at once using createPath (my array, [],[],true);

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