Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Womble on July 25, 2006 at 1:22 pm

    Hey all, just followed dan ebberts tutorial on using hte noise() function. Was wondering if somebody could go through and comment the code for me so i can better understand how it works. I have a good understanding of programming, just not the commands used in AFX!

    cheers.

    numRows = 10;
    numCols = 10;
    xyCompress = 200;
    speedCompress = 1;
    amplitude = 100;

    row = Math.floor((index – 1)/numCols);
    col = (index – 1)%numCols;
    x = col*width + width/2;
    y = row*height + height/2;
    xOffset = (this_comp.width – numCols*width)/2;
    yOffset = (this_comp.height – numRows*height)/2;

    z = amplitude*noise([x/xyCompress,y/xyCompress,time/speedCompress]);

    [x,y,z] + [xOffset,yOffset,0]

    Womble replied 20 years, 2 months ago 3 Members · 3 Replies
  • 3 Replies
  • Filip Vandueren

    July 25, 2006 at 11:06 pm

    Think of noise() as a field of values waiting to be mined:
    you feed it a value, or a position (2d or 3d), and it gives you a pseudo-random number.

    The field never changes: you’ll always get the same values from the same co

  • Dan Ebberts

    July 26, 2006 at 12:13 am

    Thanks Filip, I couldn’t have explained it better myself. 🙂

    Dan

  • Womble

    July 27, 2006 at 1:12 pm

    cheers dude i got a better idea of whats going on now, i shall re read and digest some more!!!

    cheers

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