Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float xincr, yincr, dst;
- void setup() {
- //size(600, 600);
- fullScreen();
- background(60);
- dst = height/5.5;
- strokeWeight(2);
- }
- void draw() {
- fill(0);//40
- rect(0, 0, width, height);
- translate(width/2, height/2);
- xincr += 0.01;
- yincr += 0.005;
- float yincr2 = yincr;
- for (float y = -dst; y <= dst; y += 3) {
- yincr2 += 0.01;
- float xincr2 = xincr;
- for (float x = -dst; x <= dst; x += 3) {
- xincr2 += 0.01;
- drawSquare(x, y, noise(xincr2*(mouseX-width/2)/2000, yincr2*(mouseY-height/2)/2000));
- }
- }
- }
- void drawSquare(float x, float y, float noiseFactor) {
- stroke(0, 175);
- if (noiseFactor * 450 > 255) fill(255);
- else fill(noiseFactor * 450);
- rect(x * noiseFactor * 4, y * noiseFactor * 4, 5, 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement