This is a print on demand book that I made using processing. It was originally designed as a game to be played by two people using graph paper, markers, and a pair of 30 sided die. I was making a series of drawings using this game and my friend asked why should I waste my time making these drawings when someone could easily write a program to make them instead. I thought the idea of autonomy versus monotony was interesting and I was also curious to experiment with the differences in randomness created by software trying to resemble randomness created by dice.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | import processing.pdf.*; boolean record; int[] storage = {5, 5}; int padding; void setup() { size(3000, 3000, PDF, "notRandom.pdf"); padding = width/10; background(255); smooth(); } void draw() { fill(255); rect(0, 0, width, height); for(int i=0; i<width; i+=padding) { stroke(0); strokeWeight(0); line(0, i, width, i); line(i, 0, i, height); } for(int i=0; i<2; i++) { float density = random(0, 8000)+4000; for(int x=0; x<density; x+=100) { int a = int(random(11)); int b = int(random(11)); strokeWeight(7); if (i%2!=0) stroke(0, 0, 255); else stroke(255, 0, 0); line(storage[0]*padding, storage[1]*padding, a*padding, b*padding); storage[0] = a; storage[1] = b; } } PGraphicsPDF pdf = (PGraphicsPDF) g; pdf.nextPage(); if (frameCount == 350) exit(); } |