/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117s14.sketchpad.cc/sp/pad/view/ro.I4WFf6$LESQ/rev.2199
*
* authors:
* Stefanie Walker
* 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 (CMSC117 Assignment 1)
* Keith O'Hara <[email protected]>
* Jan 2014
*
*
/ * *
*A fancier self-portrait
*Stefanie Walker
*[email protected]
*February 12, 2014 */
/* This self-portrait is different from my original because it is interactive, dynamic and a more accurate depiction of my appearance. The static portion of my self-portrait is composed of my face and hair. The animated apect lies in the never-ending changing of the background that is being covered constantly by randomly-colored circles of various transparencies overlapping one another. The dynamic aspect lies in the dragging of the mouse (which causes me to stick out my tongue!) and pressing any key (caysing my to blink!). The image is also interactive because moving the mouse across the screen causes my shirt to change colors (3 of them), depending on the side on which the mouse is located at that moment in time. */
void setup(){
size(400,400);
background(87,19,77);
x = random(0, 400);
y = random(0, 400);
smooth();
}
// COLORFUL BACKGROUND
void draw(){
float r = random(0,255);
float g = random(0,255);
float b = random(50, 255);
float a = random(0,200);
float x =random(400);
float y = random (400);
noStroke();
fill (r,g,b,a);
ellipse(x,y, 20,20);
//STATIC IMAGE SELF-PORTRAIT
//back of hair
fill(205,52,1);
noStroke();
ellipse (200,230, 300,370);
//Face
fill(250,220,188);
strokeWeight(3);
stroke(235,196,130);
rectMode(CENTER);
rect(200,350,100,100);
ellipse(200,200,210,300);
//nose
stroke(227,168,102);
strokeWeight(6);
line(204,200,204,230);
line(204,230,206,240);
line(206,240,208,250);
arc(202, 260,30, 15, 0, PI);
//eye whites
strokeWeight(3);
stroke(0);
fill(230);
ellipse(150,170,50,27);
ellipse(250,170,50,27);
//iris
strokeWeight(1.5);
fill(63,122,161);
ellipse(150,170,20,20);
ellipse(250,170,20,20);
//pupil
fill(0);
ellipse(150, 170,10,10);
ellipse(250,170,10,10);
//eyeliner
strokeWeight(3);
line(127,161,120,155);
line(124,165,120,155);
line(268,161,275,155);
line(271,165,275,155);
//eye shine
noStroke();
fill(255);
ellipse(159,167,5,5);
ellipse(259,167,5,5);
//eyebrows
strokeWeight(4);
noFill();
stroke(152, 31, 0);
arc(150, 150, 52, 30, PI+QUARTER_PI, TWO_PI);
arc(250,150, 52, 30, PI+QUARTER_PI, TWO_PI );
//mouth
stroke(160, 0, 30);
strokeWeight(5);
stroke(160, 0, 30);
strokeWeight(5);
noFill();
arc(200, 280, 80, 30, 0, PI, OPEN);
//hair
stroke(205,52,1);
fill(205,52,1);
arc(205, 127, 210, 160, -PI, 0.45);
//hair left side
ellipse (70, 160, 20,40);
ellipse (68,200,40,60);
ellipse (65, 240, 40, 40);
ellipse (66, 280, 40,60);
ellipse (84, 320, 40,60);
ellipse (100, 360, 40, 60);
ellipse (125, 380, 40, 40);
//hair rightside
ellipse (310, 130, 20,50);
ellipse (330, 160, 20,40);
ellipse (332,200,40,60);
ellipse (335, 240, 40, 40);
ellipse (324, 280, 40,60);
ellipse (316, 320, 40,60);
ellipse (300, 360, 40, 60);
ellipse (275, 380, 40, 40);
//hair strands
noFill();
ellipse (100, 140,40,80);
ellipse (95, 180, 20, 60);
ellipse (90, 250, 30, 70);
ellipse (300, 140,40,80);
ellipse (305, 180, 20, 60);
ellipse (310, 250, 30, 70);
ellipse (164, 123, 80, 20);
ellipse (200, 127, 60,20);
ellipse (260, 130, 70,40);
ellipse (250, 95, 90,90);
ellipse (275, 115, 90,90);
ellipse (285, 135, 90,90);
//Shoulders (interactive)
if (mouseX < width/3){
rectMode(CENTER);
fill (15,179,146);
noStroke();
rect (200,390,250,30);
ellipse(73,400, 50,50);
ellipse(327,400, 50,50);
fill(250,220,188);
ellipse(200,377, 110, 20);
} else if (mouseX < 2*width/3) {
fill (45, 7, 94);
noStroke();
rect (200,390,250,30);
ellipse(73,400, 50,50);
ellipse(327,400, 50,50);
fill(250,220,188);
ellipse(200,377, 110, 20);
}
else {
fill (155,11,30);
noStroke();
rect (200,390,250,30);
ellipse(73,400, 50,50);
ellipse(327,400, 50,50);
fill(250,220,188);
ellipse(200,377, 110, 20);
}
}
//STICKING MY TONGUE OUT
void mouseDragged(){
fill (253,117,117);
arc(200, 290, 80, 60, 0, PI, OPEN);
stroke(238,152,152);
strokeWeight(1.5);
line(200,290,200,317);
}
//BLINKING
void keyPressed(){
frameRate(50);
fill(0);
ellipse(150,170,50,27);
ellipse(250,170,50,27);
}