Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random Lines expression help.

  • Random Lines expression help.

    Posted by Jeff Herring on August 7, 2006 at 9:59 pm

    I’m working with Dan’s expresison that will move a vertical bar back and forth across the screen randomly.

    tMin = .5; //minimum segment duration
    tMax = 2; //maximum segment duration

    end = 0;
    j = 0;
    while (time >= end){
    j++;
    seedRandom(j,true);
    start = end;
    end += random(tMin,tMax);
    }
    endVal = random(thisComp.width);
    seedRandom(j – 1,true);
    x = random(); //this is a throw-away value
    startVal = random()*this_comp.width;
    x = ease(time,start,end,startVal,endVal);
    [x,value[1]]

    I can’t for the life of me figure out how to modify it to make a horizontal bar move randomaly up and down.
    I’m a tinkerer not a coder.. I’ve modified every setting and line that I thought might pertain to horizontal/vertical or X/Y coords and yet the thing will still keep sliding vertically.

    What am I doing wrong.

    Thanks.
    Jeff

    Jeff Herring replied 19 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mike Clasby

    August 7, 2006 at 10:48 pm

    Tinkerers Unite!

    Change the x’s to y’s and the last line as below and the last 4 lines become this:

    y = random(); //this is a throw-away value
    startVal = random()*this_comp.width;
    y = ease(time,start,end,startVal,endVal);
    [value[0],y]

    And you get Randomly moving Horz lines.
    I think your main problem was that last line,

    [value[0],value[1]]

    value [0] is the x, value [1] is the y, and if it was 3D value [2] is Z.

  • Jeff Herring

    August 8, 2006 at 4:49 pm

    Tinkerers Unite!!!

    Thanks yikesmies that did just what I needed it to.. YOU ROCK!!!!!!

    now to tinker with the speed

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