/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117s14.sketchpad.cc/sp/pad/view/ro.NBNWDm3Pncj/rev.578
*
* authors:
* Tessa von Walderdorff
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Self Portrait II", created by Keith O'Hara
// http://bard117s14.sketchpad.cc/sp/pad/view/ro.AfNeVls4vddifn/rev.71
/* A simple Self-Portrait
* Tessa von Walderdorff <[email protected]>
* 2/14/14
* An assignment that asks to create an interactive self-portrait,
incorporating static animation and dynamic aspects. The static portion of my sketch is composed of my nose, face and hair, which remain one color throughout and do not move. The dynamic aspects is composed of my mouth which continues to open and close at random and my eyes, which, if you press any key, will disappear along with the rest of my face and body and the only element remaining will be my pupils. I have made the pupils larger when everything else disappears so that it creates a hallucinagetic feel when the face and body returns and the pupils subside. Additionally, when you press a key, the background changes from purple to yellow. The image is also interactive in that if you drag the mouse from left to right you will notice that my shirt alters from pink to green. If you press the mouse, you will find that you can produce a sun-like form with lines meeting at a specific center point. This image has many differences from the first in that not all components are static. I had originally intended to make my head shake back and fourth, but I could not figure out how to do so yet with processing. Sticking to the more simple material helped me get a firm grasp of the rules and techniques.
*/
float x = random (200);
void setup() {
size (300, 362);
frameRate(2);
background(126, 96, 211);
smooth();
x = random (10, 30);
}
void keyPressed() {
background(232, 255, 9);
//pupils
frameRate(7);
fill(0);
ellipse(130, 147, 10, 15);
ellipse(170, 147, 10, 15);
}
void draw() {
ellipseMode(CENTER);
//hair
fill(232, 169, 9);
rect(123, 177, 57, 45);
//head + neck
fill(216, 180, 140);
rect(129, 150, 45, 80);
ellipse(150, 150, 70, 100);
//top hair
fill(232, 169, 9);
ellipse(150, 115, 50, 30);
//eyes
fill(49, 112, 173);
ellipse(130, 147, x, x);
ellipse(170, 147, x, x);
//pupils
fill(0);
ellipse(130, 147, 5, 10);
ellipse(170, 147, 5, 10);
//nose
line(150, 153, 145, 170);
line(145, 170, 150, 170);
//mouth
fill(173, 49, 92);
ellipse(150, 185, 15, 10 + random(-10));
//chest
fill(9, 29, 232);
rect(129, 220, 45, 120);
//changing color of shirt
if (mouseX > width/3) {
fill(98, 170, 103);
rect(129, 220, 45, 120);
}
else if (mouseX < 2*width/3) {
fill(232, 9, 229);
rect(129, 220, 45, 120);
}
else {
fill(9, 29, 232);
rect(129, 220, 45, 120);
}
}
//drawing background lines
void mousePressed() {
frameRate(2);
stroke(0);
fill(232, 9, 210);
line(mouseX, mouseY, 100, 100);
}