Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › increment gaussianRandom expression

  • increment gaussianRandom expression

    Posted by Beth Kaufer on July 25, 2007 at 8:36 pm

    I have a layer that I want to randomly place in 3D space and duplicate so I have many instances of the same thing. I have applied this expression to the position of the 3D layer

    minX = 0;
    maxX = 2000;
    minY= 480;
    maxY = 520;
    minZ= 0;
    maxZ = 500;
    gaussRandom([minX,minY,minZ],[maxX,maxY,maxZ])

    It works fine except that the layers can cluster together. Is there any way to alter the expression so that the Random values could only be generated in increments of say 25pixels. That way I can control how close together the layers could get?

    Thanks for your help.

    -BK

    Darby Edelen replied 19 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 25, 2007 at 11:44 pm

    Something like this might do it:

    factor = 25;
    minX = 0;
    maxX = 2000;
    minY= 480;
    maxY = 520;
    minZ= 0;
    maxZ = 500;
    temp = gaussRandom([minX,minY,minZ],[maxX,maxY,maxZ])
    x = Math.round(temp[0]/factor)*factor;
    y = Math.round(temp[1]/factor)*factor;
    z = Math.round(temp[2]/factor)*factor;
    [x,y,z]

    Dan

  • Darby Edelen

    July 26, 2007 at 5:46 pm

    [Bark00] “It works fine except that the layers can cluster together.”

    Isn’t that the nature of a Gaussian function?

    https://en.wikipedia.org/wiki/Gaussian_function

    Overall, the information on this page goes a little over my head, but the graphs should be the telling parts.

    Darby Edelen
    DVD Menu Artist
    Left Coast Digital
    Aptos, CA

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