Week 4 Homework

This was an attempt to create the image of a penguin surfing as in the movie “Surf’s Up”.

Here is my recreation of the scene where the two penguins are surfing together.

My Code:

void setup() {
size (500,500);
}

void draw() {

background(#43BBDE); // Sky

stroke(#DEDCAA);// Sand
fill(#DEDCAA);
rect(0,0,500,75);

stroke(#2F9CBC);//Wave 1
fill(#2F9CBC);
beginShape();
vertex(1, 517);
bezierVertex(200, 517, 272, 13, 458, 246);
bezierVertex(108, 219.11111068725586, 646, 785.1111106872559, 1152, 412.11111068725586);
endShape();

pushMatrix ();
translate(-265,0);
beginShape(); //Wave 2
vertex(1, 517);
bezierVertex(200, 517, 272, 13, 458, 246);
bezierVertex(108, 219.11111068725586, 646, 785.1111106872559, 1152, 412.11111068725586);
endShape();

fill(#2F9CBC);
rect(0,475,800,300);

translate(0,160);
stroke(#FFA443); //Surfboard
fill(#FFA443);
curve(360, 406, 374, 198, 540, 208, 530, 417);
curve(360, 8, 374, 198, 540, 208, 530, 32);
stroke(#43FF4D);
strokeWeight(5);
line(373,200,540,205);

translate(15,25);
strokeWeight(1); // Penguin
stroke(0,0,0);
fill(0,0,0);
curve(416, 663, 410, 153, 459, 152, 480, 704);
stroke(255,255,255);
fill(255,255,255);
curve(429, 521, 422, 153, 450, 152, 474, 520);
strokeWeight(10);
stroke(0,0,0);
point(418,155);
point(454,155.5);
strokeWeight(30);
point(432,85);

strokeWeight(4);
stroke(255,255,255);
point(428,80);
point(438,80);

translate(377,24);
scale(.2);
strokeWeight(3);
stroke(#FFE340);
fill(#FFE340);
beginShape(); // Beak
curveVertex(244, 248);
curveVertex(265, 320);
curveVertex(315, 352);
curveVertex(296, 310);
curveVertex(298, 234);
endShape();
popMatrix ();

pushMatrix();
if (mouseX<250){
translate(25,160);
stroke(#FFA443); //Surfboard 2
fill(#FFA443);
curve(360, 406, 374, 198, 540, 208, 530, 417);
curve(360, 8, 374, 198, 540, 208, 530, 32);
stroke(#43FF4D);
strokeWeight(5);
line(373,200,540,205);

}else{

translate(-265,160);

stroke(#FFA443); //Surfboard 3
fill(#FFA443);
curve(360, 406, 374, 198, 540, 208, 530, 417);
curve(360, 8, 374, 198, 540, 208, 530, 32);
stroke(#43FF4D);
strokeWeight(5);
line(373,200,540,205);
}
popMatrix();

pushMatrix();
if (mouseX<250){
translate(18,185);
strokeWeight(1); // Penguin
stroke(0,0,0);
fill(0,0,0);
curve(416, 663, 410, 153, 459, 152, 480, 704);
stroke(255,255,255);
fill(255,255,255);
curve(429, 521, 422, 153, 450, 152, 474, 520);
strokeWeight(10);
stroke(0,0,0);
point(418,155);
point(454,155.5);
strokeWeight(30);
point(432,85);

strokeWeight(4);
stroke(255,255,255);
point(428,80);
point(438,80);

translate(377,24);
scale(.2);
strokeWeight(3);
stroke(#FFE340);
fill(#FFE340);
beginShape(); // Beak
curveVertex(244, 248);
curveVertex(265, 320);
curveVertex(315, 352);
curveVertex(296, 310);
curveVertex(298, 234);
endShape();

}else{

translate(-250,185);
strokeWeight(1); // Penguin
stroke(0,0,0);
fill(0,0,0);
curve(416, 663, 410, 153, 459, 152, 480, 704);
stroke(255,255,255);
fill(255,255,255);
curve(429, 521, 422, 153, 450, 152, 474, 520);
strokeWeight(10);
stroke(0,0,0);
point(418,155);
point(454,155.5);
strokeWeight(30);
point(432,85);

strokeWeight(4);
stroke(255,255,255);
point(428,80);
point(438,80);

translate(377,24);
scale(.2);
strokeWeight(3);
stroke(#FFE340);
fill(#FFE340);
beginShape(); // Beak
curveVertex(244, 248);
curveVertex(265, 320);
curveVertex(315, 352);
curveVertex(296, 310);
curveVertex(298, 234);
endShape();
}
popMatrix();
}

Leave a comment

Design a site like this with WordPress.com
Get started