Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Sinc Math.Sin() with the Wave Warp Effect

  • Andreas Woelfl

    November 19, 2015 at 11:35 am

    I try to continue this post for my next related problem.

    Next to the circle there should be more of them, each one liningup the wave as well.
    I regulate the distance of the other circles next to the main one with an Expression Slider.

    All the layers are at the top of the comp timeline:

    Index 1: Circle 1 (Main Circle)
    Index 2: Circle 2
    Index 3: Circle 3
    Index 4: Circle 4

    … you get the idea

    As I understand I should only change the phase of the Math.sin for everyone.
    I am searching for a formula including the distance of the circles and their index (just to add more circles if necessary).

    My math is really rusty and everything I tried so far did not work out.

    Here is what I got so far. It points in the direction I want to go but still does not line up correctly. (I changed the circles with small crosses to see how it lines up):
    9473_sinustest.aep.zip

    Any ideas?

    Thanks a lot!

    Here the expressions I used so far.

    // X POSITION
    var xDistancia = (content("Ellipse 1").content("Ellipse Path 1").size[0]) + (thisComp.layer("Adjustment Layer 8").effect("xDistance")("Slider"));

    var xPos = thisComp.layer(thisLayer, -1).transform.position[0] - xDistancia;

    //Y POSITION
    var amplitude = thisComp.layer("Background 04 Bottom 3").effect("Wave Warp")("Wave Height");
    var frequency = Math.PI;

    var yDelay = (thisComp.width/transform.position[0])*thisComp.layer("Adjustment Layer 8").effect("yDelay")("Slider");
    var phase = yDelay*index

    yPos = transform.position[1] + amplitude * Math.sin(frequency*time+phase);

    [xPos, yPos]

  • Kalleheikki Kannisto

    November 19, 2015 at 2:12 pm

    // X POSITION
    xDistancia = thisComp.layer("Adjustment Layer 8").effect("xDistance")("Slider");
    xPos = thisComp.layer(thisLayer, -1).transform.position[0] - xDistancia;

    //Y POSITION
    amplitude = thisComp.layer("Background 04 Bottom 3").effect("Wave Warp")("Wave Height");
    frequency = Math.PI;
    phase_offset = (index-1)*Math.PI*(xDistancia/thisComp.layer("Background 04 Bottom 3").effect("Wave Warp")("Wave Width"));
    yPos = transform.position[1] + amplitude * Math.sin(frequency*time+phase_offset);

    [xPos, yPos]

    In essence, since one full wave length is PI, you can use X_distance divided by wave length (multiplied by Math.PI) for the phase offset (Which makes the “Y Delay” slider unnecessary).

Page 2 of 2

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