Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // original code from Matt Pearson
- float xstart, ystart, squaresize;
- void setup() {
- size(400, 400);
- background(150);
- xstart = random(10);
- ystart = random(10);
- squaresize = height/8;
- }
- void draw() {
- background(20);
- noStroke();
- //stroke(0);
- fill(150);
- xstart += 0.02;
- ystart += 0.01;
- translate(width/2, height/2);
- float ynoise = ystart;
- for (float y = -squaresize; y <= squaresize; y+=3) {
- ynoise += 0.02;
- float xnoise = xstart;
- for (float x = -squaresize; x <= squaresize; x+=3) {
- xnoise += 0.02;
- drawPoint(x, y, noise(sin(xnoise), cos(ynoise)));
- }
- }
- //if (frameCount%3==0 && frameCount < 314) saveFrame("image-####.gif");
- }
- void drawPoint(float x, float y, float noiseFactor) {
- pushMatrix();
- translate(x * noiseFactor * 4, y * noiseFactor * 4);
- float edgeSize = noiseFactor * 10;
- ellipse(0, 0, edgeSize, edgeSize);
- popMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement