Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions wiggle within a cirlcles radius – how?

  • wiggle within a cirlcles radius – how?

    Posted by Thor Sarup on April 28, 2013 at 7:49 pm

    I want to wiggle a layers position put inside a certain radius. Is that possible?

    I gueess the solution is not to just wiggle and check if its outside the radius and then just force it inside cos thats not a true wiggle.

    var radius = 300;
    w = wiggle(0.7,radius,2);

    [w[0], w[1], 0];

    Thor Sarup replied 13 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Thor Sarup

    April 30, 2013 at 7:02 am

    anyone?

  • Xavier Gomez

    April 30, 2013 at 1:16 pm

    You can try this:
    f = 0.7;
    R = 300;

    w = wiggle(f,R,2) - value;
    z = Math.max(Math.abs(w[0]), Math.abs(w[1]));
    w = z*normalize(w);
    value + w;

    If it is very important that the position stays in the specified disc, you may have to reduce the radius a bit, especially if you add harmonics to the wiggle.

    You can also try polar coordinates. Put 2 controls:
    Slider: name: “radius”, value: 150, expression: wiggle(0.7,150,2);
    Angle: name: “angle”, value: any, expression: wiggle(0.1,720,2);

    and this expression on the position:
    radius = effect("radius")("Slider");
    angle = effect("angle")("Angle")*Math.PI/360;
    value + radius*[Math.cos(angle),Math.sin(angle)];

    Changing the wiggle parameters for the radius and the angle give completely different behaviours (it is better to add harmonics to the angle than higher frequency, otherwise the solid moves in too obvious circles).

  • Thor Sarup

    April 30, 2013 at 1:30 pm

    Thanks Xavier 🙂 I haven’t tried your suggestions yet. When posting I was also worried the same problem as in your second solution – too obvious circular movements. But how about the first one – will it have the same issue?

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