Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float xOff, yOff, zOff;
- int step = 5;
- PGraphics pg;
- void setup() {
- size(540, 540, P2D);
- pg = createGraphics(width, height, P2D);
- }
- void draw() {
- background(255);
- xOff=0;
- for (int x=0; x<width; x+=step) {
- yOff=0;
- xOff += 0.05;
- for (int y=0; y<width; y+=step) {
- float ns = noise(xOff,yOff, zOff);
- float sz = map(ns, 0, 1, 0, step*2);
- noStroke();
- fill(0);
- if (ns<0.6)fill(255, 100, 0);
- if (ns>0.5) ellipse(x, y, sz, sz);
- yOff += 0.03;
- }
- }
- createMask();
- blend(pg,0,0,width, height, 0,0,width, height, MULTIPLY);
- zOff += 0.025;
- if (frameCount<=200) saveFrame("/Volumes/Anim/image-###.gif");
- }
- void createMask() {
- float sz = width*.75;
- pg.beginDraw();
- pg.background(0);
- pg.fill(255);
- pg.noStroke();
- pg.ellipse(width/2,height/2,sz,sz);
- pg.endDraw();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement