Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Brownian Motion / “Random Walk”

  • Brownian Motion / “Random Walk”

    Posted by Brian Smith on April 23, 2012 at 10:47 pm

    Hey All,

    I have a client requesting me to do a simple animation replicating the concept of Brownian Motion. This is going to into a University where they actually study it, so it has to be quite accurate. The reference movie they sent me can be found here.

    It looks simple enough, and I’ve actually come quite close using Particular. You can see in my screenshot the result I currently have and how I got there. I have basically parented the Particular Emitter to a Null with a simple wiggle expression for the small moves. I then parented that Null to a second Null that gives me the larger moves around the comp. My problem at the moment is that the “Larger Movement Null” is constrained to just 300 units from the comp center. I would like to constrain it to the overall comp size and say that it can’t move more than say 50 pixels at a time. I want it to be able to move all over the comp, but constrain it to smaller moves to do so if that makes sense. In the reference video, the emitter never seems to move more than maybe 20 or 30 pixels at a time.

    I hope this makes sense. Please let me know if you need clarification.

    Thanks everyone!
    -Brian

    seedRandom(thisComp.layer("Large Mover Controls").effect("Random Seed")("Slider"));
    //wiggle(.1,300)

    wiggle(.1, 300, octaves = thisComp.layer("Large Mover Controls").effect("Octaves")("Slider"), amp_mult =thisComp.layer("Large Mover Controls").effect("Amp Mult")("Slider"), t = time)

    Brian Smith replied 14 years ago 1 Member · 1 Reply
  • 1 Reply
  • Brian Smith

    April 23, 2012 at 11:35 pm

    Okay, I wish I would have found this first.

    I took this and placed it in, and this gets me what I need for constraining the emitter to the comp size perfectly! Now how might I constrain the distance that it travels between “segMin” and “segMax” ?

    Thanks! (and sorry again for not finding this sooner.)

    segMin = .2; //minimum segment duration
    segMax = .6; //maximum segment duration
    minVal = [0.1*thisComp.width, 0.1*thisComp.height];
    maxVal = [0.9*thisComp.width, 0.9*thisComp.height];

    end = 0;
    j = 0;
    while ( time >= end){
    j += 1;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    endVal = random(minVal,maxVal);
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    startVal = random(minVal,maxVal);
    ease(time,start,end,startVal,endVal)

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