For my self-portrait, I decided to go down a slightly different path as shown in the screenshot below. In this strange piece, I reflect upon myself, New York’s finest distractions, and my processing skills.
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 |
float lineWidth = 10; void setup() { size(800, 600); background(0); noStroke(); stroke(255, 255, 255); line(mouseX, mouseY, pmouseX, pmouseY); } void draw(){ strokeWeight(lineWidth); if (mousePressed && (mouseButton == LEFT)) { line(mouseX, mouseY, pmouseX, pmouseY); } if (mousePressed && (mouseButton == RIGHT)) { rect(mouseX, mouseY, pmouseX, pmouseY); } } void keyPressed(){ if(key == '+'){ lineWidth++; } if(key == '-'){ lineWidth--; if(lineWidth <= 0){ lineWidth = 1; } } if(key == ' '){ background(0); } if(key == 'p'){ stroke(0,0,0); } if(key == 'o'){ stroke(255,155,0); } if(key == '['){ stroke(255,255,255); } } |
I didn’t want to display the various key functions as I wanted a clear canvas to paint on. But, I did want to incorporate a few different options to make the painting more fun.
Bonus! Some various other sketches made with slightly edited code (not included) before I arrived at the final masterpiece, (featuring Phil the tilted).