Month: June 2015

  • Exercise 52

    // P_2_1_2_02.pde // // Generative Gestaltung, ISBN: 978-3-87439-759-9 // First Edition, Hermann Schmidt, Mainz, 2009 // Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni // Copyright 2009 Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni // // http://www.generative-gestaltung.de /** * changing module color and positions in a grid * * MOUSE * position x :…

  • Exercise 51

    // P_2_1_3_01.pde // // Generative Gestaltung, ISBN: 978-3-87439-759-9 // First Edition, Hermann Schmidt, Mainz, 2009 // Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni // Copyright 2009 Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni // // http://www.generative-gestaltung.de /** * changing circle amount, size and position in a grid * * MOUSE * position x…

  • Exercise 50

    /*——– Circle Pattern —————-*/ int margin; int res = 4; int padding; color c [] = { #75a665, #5c801a, #5a7e18, #735742, #afb837, #564311, #32320e }; void setup () { size (700, 700); smooth(); frameRate (10); margin = width/10; padding = width /30; } void draw () { background (237); randomSeed (year() + day() + hour()…

  • Bonus: Glitch

    PImage img; int min = 40, max = 80; int r = 10; void setup() { img = loadImage(“https://s-media-cache-ak0.pinimg.com/736x/2c/f6/a5/2cf6a58f75b368949cf98db03b925f1b.jpg”); size(img.width, img.height); image(img,0,0); } void draw() { int w = (int)random(min, max); int h = int(w*3); int x = (int)random(0, width-w); int y = (int)random(0, height-h); PImage tmp = createImage(w, h, RGB); tmp.loadPixels(); float rd =…

  • Exercise 45

    using rotation and sine cosine functions to draw patterns. float k = 2/7.0; int scaleIt = 400; void setup() { size(800, 800); background(20); colorMode(HSB); strokeWeight(0.01); smooth(); } void draw() { translate(width/2, height/2); //scale(width/2, height/2); float t = frameCount / 20.0; float x = cos(k*t) * sin(t) * scaleIt; float y = cos(k*t) * cos(t) *…

  • Exercise 44

    int num=10, sw=8, fc; float r; long rs; boolean save = false; void setup() { size(500, 500); //colorMode(HSB, 360, 100, 100); noFill(); rs = (long) random(100); strokeWeight(sw); strokeCap(SQUARE); } void draw() { randomSeed(rs); background(#14133B); for (int i=0; i < 3; i++) { arcs(width/2, height/2); } if (save) { if (frameCount%2==0 && frameCount < fc+241) saveFrame("frames/image-###.png");…

  • Exercise 43

    int num=50, d=100, frames=120; float theta; void setup() { size(540, 540, P2D); blendMode(SCREEN); stroke(255); noStroke(); fill(255); //noFill(); } void draw() { background(0); for (int j=0; j < 3; j++) { if (j==0) fill(255, 0, 0); if (j==1) fill(0, 255, 0); if (j==2) fill(0, 0, 255); for (int i=0; i < num; i++) { float angle…

  • Exercise 42

    int frames = 235, num=30; float theta; void setup() { size(750, 750); rectMode(CENTER); } void draw() { background(20); noFill(); translate(width/2, height/2); for (int i=0; i < num; i++) { pushMatrix(); float offSet=TWO_PI/num*i; rotate(offSet); float sz = map(sin(theta), -1, 1, width*.15, width*.2); float x = map(sin(theta), -1, 1, sz, width*.2); translate(x, 0); pushMatrix(); rotate(theta); stroke(200); if…

  • Exercise 41

    int frames = 220, num=30; float theta; void setup() { size(750, 750); } void draw() { background(20); stroke(#9EC3CE, 255); strokeWeight(2); noFill(); translate(width/2, height/2); for (int i=0; i < num; i++) { pushMatrix(); float offSet=TWO_PI/num*i; rotate(offSet); float sz = map(sin(theta),-1,1,width*.15,width*.2); float x = map(sin(theta), -1, 1, sz, width*.2); translate(x, 0); pushMatrix(); rotate(theta); if (i%2==0) { ellipse(0,…

  • Exercise 40

    Outputting an animation as video takes two steps saving frames of the animation as separate image files compiling the sequence of images into a movie using MovieMaker tool int frames = 200, num=20; float theta; void setup() { size(750, 750); } void draw() { background(20); fill(255, 30); stroke(255, 50); translate(width/2, height/2); for (int i=0; i…