Friday, June 20, 2008

patterns

Patterns are generated with simple operations on each pixel in the frame. Combining the pixel index (j) with the width and height of the frame and a small incrementing decimal (count, the frame number of the animation) through modulus and scaling determines if the pixel is filled black or passed over.


pixels[floor(constrain(((j%height)*width+(j%(count*j)%width)), 0, pixels.length-1))]


view this sketch
press 1-7 for variations, p to pause/unpause, r to go to random position in animation


close sketch

1 comment:

  1. this is great. also love the way you made the sketches appear on the sidebar - very neat!!

    ReplyDelete