Category: Lessons

  • Bonus: Waves

    int i, w=1024, h=768, x, y, s=10; float k, m, r, j=.01; void setup() { size(w, h, P3D); noStroke(); } void draw() { background(#A4D6E8); lights(); beginShape(8); for (i=0; i < w*h; i+=s) { x=i%w; y=i/w; k=y+s; m=x+s; fill(100, 100, random(220,255), 200); vertex(x, n(y*w+x), y); vertex(m, n(y*w+m), y); vertex(m, n(k*w+m), k); vertex(m, n(k*w+m), k); vertex(x, n(k*w+x),…

  • Creating a lamp with Processing

    We will use an existing Processing library to create the pieces for the laser-cut lamp. Let’s follow the instructions here. Codeable Objects Library Codeable Objects is a library for Processing that allows anyone to design and construct an artifact using geometric computation and digital fabrication. This tutorial will show you how to use the library…

  • Bonus: Circular Galaxy

    int num = 40, circles=80, frames=60; float theta; void setup() { size(540, 540); } void draw() { randomSeed(3453); background(0); noStroke(); float angle = 0; for (int j=0; j < circles; j++) { fill(255, 25); float r = random(TWO_PI); beginShape(TRIANGLE_STRIP); float r2 = random(30, 50); for (int i=0; i < num; i++) { angle=TWO_PI/num*i+r; float offSet=TWO_PI/num*i;…

  • Bonus: Glitch 2

    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() { doStuff(); } void keyPressed() { save(random(123456)+”.jpg”); } void doStuff() { PImage tmp = createImage(width, height, RGB); tmp.loadPixels(); float rd = random(25, 100); for (int px=0; px <…

  • Bonus: Mouse Follower

    // P_2_2_3_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 /** * form mophing process by connected random agents * two forms: circle and line * *…

  • Exercise 55

    int _numChildren = 4; int _maxLevels = 4; Branch _trunk; void setup() { size(750,500); background(255); noFill(); smooth(); newTree(); } void newTree() { _trunk = new Branch(1, 0, width/2, height/2); _trunk.drawMe(); } void draw() { background(255); _trunk.updateMe(width/2, height/2); _trunk.drawMe(); } class Branch { float level, index; float x, y; float endx, endy; float strokeW, alph; float…

  • Exercise 54

    // P_2_1_3_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 /** * draw a module made of lines in a grid * * MOUSE * position x…

  • Exercise 53

    // P_2_1_3_04.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 positions of stapled circles in a grid * * MOUSE * position x :…

  • 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…