Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fractal Noise – Offset & Rotate

  • Fractal Noise – Offset & Rotate

    Posted by Vladislav Macíček on April 30, 2017 at 5:22 pm

    Hi. First of all let me say that I am new here and my English may not be the best, so please bear with me…

    OK, here’s the problem:

    I have 2 points (“Start” & “End”) with coordinates [X1, Y1] and [X2, Y2] + a layer with Fractal Noise. In Fractal Noise I want the Offset Turbulence to follow the starting point (which is easy), but aslo move certain distance in Start-to-End direction each frame.

    For that moving factor I’ve got this:
    speed = percentage/100; // Let’s say 0.25
    So every frame it would offset by (X1 – X2)*0.25 in X axis and by (Y1 – Y2)*0.25 in Y axis. But still linked to the position of “Start”.

    In some early tests I tried putting
    effect(“Fractal Noise”)(“Offset Turbulence”).valueAtTime(time – thisComp.frameDuration);
    in a Point Control and reusing it in the main expression, but it’s just pointing at the “pre-expressioned” value of the Offset Turbulence.

    I know that expressions have no memory of their previous values, so that’s why I’m asking – is it it even possible?

    Just to clarify it a little bit – I am looking for something similar to “Lock Noise to Saber” feature in the Saber plug-in by Video Copilot. So ideally, the rotation should also vary, which I already kind of figured out:
    if (X1 – X2 < 0){
    Math.atan((Y1 – Y2)/(X1 – X2))*(180/Math.PI)
    }else{
    Math.atan((Y1 – Y2)/(X1 – X2))*(180/Math.PI) + 180
    }

    … but since Fractal Noise has no Anchor Point (it’s rotating around that Offset point instead of the the “Start” point), it would make everything so much more complicated that for now I’m just focusing on the Offset Turbulence (but if you’ve got any ideas, I would appreciate it).

    I hope I’ve described it well enough, otherwise just ask me and I’ll try to clear everything up.

    Thank you in advance for any help, Vladislav.

    Vladislav Macíček replied 9 years, 3 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    April 30, 2017 at 7:37 pm

    Something like this probably:

    perFramePct = .25;
    p1 = thisComp.layer(“Start”).transform.position;
    p2 = thisComp.layer(“End”).transform.position;
    deltaF = timeToFrames(time)-timeToFrames(inPoint);
    fromComp(p1 + (p2 – p1)*deltaF*perFramePct);

    The perFramePct seems high–it only takes 4 frames to go from Start to End.

    Dan

  • Vladislav Macíček

    April 30, 2017 at 9:57 pm

    Wow! It works just perfectly. And also – Dan Ebberts himself!

    Seriously, thank you.

    OK, final question. How would you make it so that its rotation is aligned with those points? Sorry, I don’t know how to put it… If you imagine every point on the Start-End segment and the “End” point moves within couple of frames, all those imaginary points would be further away from “Start” (which now works), but they would also rotate around the “Start” point, so they are still on the Start-End line. I hope it makes sense like that.

    Maybe I could just use the Fractal Noise effect on a bigger solid and rotate it using classic transform options, but I don’t know – it sounds a little bit clumsy. Any advice?

  • Dan Ebberts

    April 30, 2017 at 10:43 pm

    I think I’d need to see a sketch or something.

    Dan

  • Vladislav Macíček

    May 1, 2017 at 9:23 am

    All right, here’s a picture of how it should work:

    a and b are just random imaginary points on the Start-End line in Fractal Noise, alpha is the angle driven by this expression I mentioned before:
    if (X1 - X2 < 0){
    Math.atan((Y1 - Y2)/(X1 - X2))*(180/Math.PI)
    }else{
    Math.atan((Y1 - Y2)/(X1 - X2))*(180/Math.PI) + 180
    }

    Vladislav

  • Dan Ebberts

    May 1, 2017 at 4:27 pm

    Try this:

    p1 = thisComp.layer(“Start”).transform.position;
    p2 = thisComp.layer(“End”).transform.position;
    v = p2-p1;
    radiansToDegrees(Math.atan2(v[1],v[0]))

    Dan

  • Vladislav Macíček

    May 1, 2017 at 5:46 pm

    Well, it works OK but when I put it in Rotation in Fractal Noise, it still rotates around the Offset point instead of the “Start” – so when I mess with “Start” and “End” locations, it occasionally moves backwards…

    Vladislav

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