/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.7KbK0NVL7zp/rev.88
*
* authors:
* Abhinanda Bhattacharyya
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/*Abhinanda Bhattacharyya, 9/23/2012, [email protected], Self Portrait II
In this self-portrait, I tried to combine some of the dynamic functions of Processing with the more static functions, because I hoped to create something that was both abstract and representational at the same time. This Self Portrait depicts a boy listening to "modern" music, represented by the "sound waves" and colored words next to the speakers. The main dynamic elements of this portrait are the color changes of the background (controlled by the movement of the mouse), what I was hoping could be a mirrored disco ball (though it was hard to find a good way to represent this and this was my best attempt) and the basketball.
This is different from my Design Blocks portrait in both its static as well dynamic aspects. My Design blocks portrait was purely abstract, whereas here I made more of an effort to position the objects I used systematically to create a real scenario. Because of this, this portrait took longer to write a code for and required more attention to detail, but I thought in all of that Processing was far less limiting and I was happy to be able to go back and re-write code that needed improvement. In addition, the ability to write in comments throughout the code made the process a lot easier.
*/
int circley;
int dy = 0;
float x;
float y;
float z;
void setup(){
size(600, 600);
noStroke();
fill(196);
smooth();
circley = 308;
}
void mouseDragged(){
ellipse(mouseX, mouseY, 20,20);
}
void draw(){
if(mouseX>250){
background(0,210,2000);
}
background(mouseX,mouseY,0);
//head
stroke(0);
strokeWeight(3);
fill(#F0C58C);
ellipse(300, 200, 150, 150);
//left eye
fill(255);
ellipse(280, 180, 30, 30);
//right eye
fill(255);
ellipse(320, 180, 30, 30);
//left pupil
fill(0);
ellipse(280,180,10,10);
//right pupil
fill(0);
ellipse(320,180,10,10);
//nose
fill(0);
ellipse(300,205, 7,7);
// mouth
noStroke();
fill(255,0,0);
ellipse(300, 240, 50,5);
//cap
stroke(0);
strokeWeight(3);
fill(245,25,0);
arc(300, 160, 135, 100, -PI, 0);
rect(360,140, 60,20);
//body
stroke(0);
strokeWeight(4);
line(300,277,300,425);
line(300,315,355,310);
line(300,315, 245,310);
line(300,425,270,487);
line(300,425,330,487);
//speakers
fill(0);
rect(18,330,132,157);
fill(255);
textSize(15);
text("Bose SoundLink", 30, 361);
stroke(0);
strokeWeight(3);
line(82,329,59,272);
line(82,329,108,272);
//ground
fill(#E89921);
rect(0,488,600,112);
//lights
stroke(0);
strokeWeight(3);
line(200,0,200,5);
x= random(255);
y=random(255);
z=random(255);
fill(x,y,z);
ellipse(200,50,90,90);
//sound
stroke(0);
strokeWeight(2);
line(164,374,214,374);
line(184,415,222,415);
line(173,452,211,452);
line(168,342,214,342);
textSize(10);
text("womp",181,385);
text("womp",186,427);
text("womp",179,396);
text("womp",191,407);
text("womp",182,358);
text("womp",185,435);
text("womp",178,442);
//poster
stroke(0);
strokeWeight(3);
fill(255);
rect(392,0,600,115);
fill(0);
textSize(40);
text("deadmau5",400,39);
textSize(20);
text("In Concert September 25", 460,66);
text("Madison Square Garden", 470,93);
strokeWeight(5);
point(409,100);
//ball
stroke(0);
strokeWeight(1);
fill(#B2A797);
ellipse(373,circley,40,40);
circley = circley + dy;
circley = constrain(circley, 0, 487);
if(circley >= 487){
dy = -7;
}
if(circley <= 308){
dy = 7;
}
}