Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int step=2, frames=300;
- float xOff, yOff, theta, sx, sy;
- void setup() {
- size(540, 400);
- //colorMode(HSB, 360, 100, 100);
- createStuff();
- sx = random(10000);
- sy = random(1000);
- }
- void draw() {
- createStuff();
- theta += TWO_PI/frames;
- //if (frameCount<=frames) saveFrame("image-###.gif");
- }
- void keyPressed() {
- save(random(123)+".jpg");
- }
- void mouseReleased() {
- background(0);
- sx = random(200);
- sy = sx + random(10000);
- createStuff();
- }
- void createStuff() {
- xOff = sx;
- for (int x=0; x<width; x+=step) {
- yOff = sy;
- for (int y=0; y<height; y+=step) {
- int col = (int) map(noise(xOff+sin(theta), yOff+cos(theta), sin(theta)), 0, 1, 0, 255);
- fill(col,50,80);
- noStroke();
- rect(x, y, step, step);
- yOff += 0.005;
- }
- xOff += 0.05;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement