PGraphics pg; PImage tex; float rotx = PI/4; float roty = PI/4; int maxCubes = 12; int maxLines = 3; float atten = .8; float amtAlpha = atten; float saturate = .1; float randXX; float randYY; float randColor; float randLength; int tone; float thick; color bgColor = color(0,0,0); color satColor; color [] colors = { color(230,22,255,255), color(230,100,25,25), color(167,150,55,255), color(124,250,55,255), color(100,5,255,255), color(200,250,255,55), color(25,250,255,255)}; float time = 0; float margin = 300; int odd = 0; int blurOn = 1; int colorOn = 1; void setup() { colorMode(HSB,1.0); pg = createGraphics(100,100,P2D); pg.colorMode(HSB,1.0); tex = createImage(100,100,ARGB); size(500, 500,P3D); textureMode(NORMALIZED); } void draw() { if (keyPressed) { if (key == 'b') { blurOn = 1 - blurOn; } } if (keyPressed) { if (key == 'v') { colorOn = 1 - colorOn; } } pg.beginDraw(); if (keyPressed == true) { if (key == 'c') { pg.loadPixels(); for (int i = 0; i < (pg.pixels.length); i++) { pg.pixels[i] = color(0,0,0,0); } } } randLength = random(0,50); randColor = noise(frameCount) * 255; randXX = random(20,50); randYY = random(10,80); thick = noise(thick+frameCount) * 10; pg.strokeWeight(noise(thick*frameCount)+2); tone = int(noise(frameCount)*colors.length); if (colorOn == 1) { pg.stroke(colors[tone]); } else { pg.stroke(color(.3,0,1,1)); } if (odd == 1) { pg.line(randXX,randYY,randXX+randLength,randYY); } else { pg.line(randXX,randYY,randXX,randYY+randLength); } pg.loadPixels(); for (int i = 0; i < (pg.pixels.length); i++) { pg.pixels[i] = color(hue(pg.pixels[i]), constrain(saturation(pg.pixels[i]) + saturate,0,1), brightness(pg.pixels[i]), alpha(pg.pixels[i]) * amtAlpha); } if (blurOn == 1) { pg.filter(BLUR,.8); amtAlpha = .97; } else { amtAlpha = atten; } pg.endDraw(); tex = pg; background(bgColor); noStroke(); for (int i =0;i