xxxxxxxxxx
float numCircs = 5;
float angle = radians (360 / numCircs);
float distance = 300;
float offset = radians (90);
float counter = 0.01;
int numFlowers = 8;
int numFlowersTop = 8;
Flower [] newFlowers = new Flower [numFlowers];
FlowerTop [] newFlowerTop = new FlowerTop [numFlowersTop];
//Flowers
Flower poppy;
Flower daisy;
FlowerTop tulip;
FlowerStill redandyellow;
FlowerStill2 ray2;
FlowerStill3 ray3;
Leaves leaf;
Leaves leaf2;
Leaves leaf3;
Leaves leaf4;
Leaves leaf5;
Leaves leaf6;
Leaves midleaf;
Leaves midleaf2;
Leaves midleaf3;
Leaves midleaf4;
Leaves midleaf5;
void setup () {
size (800, 800);
smooth();
//Flowers
poppy = new Flower ();
daisy = new Flower ();
tulip = new FlowerTop();
redandyellow = new FlowerStill();
ray2 = new FlowerStill2();
ray3 = new FlowerStill3();
leaf = new Leaves();
leaf2 = new Leaves();
leaf3 = new Leaves();
leaf4 = new Leaves();
leaf5 = new Leaves();
leaf6 = new Leaves ();
midleaf = new Leaves ();
midleaf2 = new Leaves();
midleaf3 = new Leaves ();
midleaf4 = new Leaves ();
midleaf5 = new Leaves ();
//Flowers Array
for (int index = 0; index < numFlowers; index++) {
newFlowers [index] = new Flower();
}
for (int index = 0; index < numFlowersTop; index++) {
newFlowerTop [index] = new FlowerTop();
}
}
void draw () {
background(#29524D);
//Circles background
for (int x = 88; x < 700; x = x + 50) {
for (int y = 50; y < 750; y = y + 50) {
fill(#FCBD5E);
strokeWeight(2);
stroke(0);
ellipse(x, y, 25, 25);
}
}
//Mountains background top
for (int x = 10; x < 700; x = x + 110) {
fill(#29CFFF); //bright blue
noStroke();
triangle(x, 25, x+100, 25, x+50, 400);
}
//Mountains background top 2
for (int x = 30; x < 700; x = x + 110) {
fill(#1C6A19); //dark green
stroke(#2B8627); //lighter green
strokeWeight(8);
triangle(x, 35, x+60, 35, x+30, 200);
}
//Mountains background bottom
for (int x = 10; x < 700; x = x + 110) {
fill(#273181); //dark blue
noStroke();
triangle(x, 775, x+100, 775, x+50, 400);
}
//Mountains background bottom 2
for (int x = 30; x < 700; x = x + 110) {
fill(250);
stroke(#6C75BF); //pale blue
strokeWeight(8);
triangle(x, 765, x+60, 765, x+30, 600);
}
//Flowers Array
for (int index = 0; index < numFlowers; index++) {
newFlowers[index].move();
newFlowers[index].display();
}
for (int index = 0; index < numFlowersTop; index++) {
newFlowerTop[index].move();
newFlowerTop[index].display();
}
//Rotating Circles
fill (#F0F581); //yellow
noStroke();
for (int i = 1; i <= numCircs; i++){
float x = cos(angle * i + offset) * distance + width/2;
float y = sin(angle * i + offset) * distance + height/2;
ellipse (x - 40, y - 80, 150, 150);
}
offset = offset + counter;
//Leaves
fill(#64EA50); //bright green
triangle(150, 50, 200, 50, 150, 100);
triangle(175, 100, 250, 75, 300, 100);
triangle(200, 75, 250, 50, 300, 50);
triangle(200,50, 225, 25, 220,50);
leaf.display();
leaf2.display();
leaf2.display();
leaf2.x = 100;
leaf2.y = 50;
leaf2.x2 = 100;
leaf2.y2 = 50;
leaf2.x3 = 100;
leaf2.y3 = 50;
leaf3.display();
leaf3.display();
leaf3.x = 300;
leaf3.y = 50;
leaf3.x2 = 300;
leaf3.y2 = 50;
leaf3.x3 = 300;
leaf3.y3 = 50;
leaf4.display();
leaf4.display();
leaf4.x = 250;
leaf4.y = 10;
leaf4.x2 = 250;
leaf4.y2 = 10;
leaf4.x3 = 250;
leaf4.y3 = 10;
leaf5.display();
leaf5.display();
leaf5.x = 200;
leaf5.y = -25;
leaf5.x2 = 200;
leaf5.y2 = -25;
leaf5.x3 = 200;
leaf5.y3 = -25;
leaf6.display();
leaf6.display();
leaf6.x = 100;
leaf6.y = -25;
leaf6.x2 = 100;
leaf6.y2 = -25;
leaf6.x3 = 100;
leaf6.y3 = -25;
midleaf.display();
midleaf.display();
midleaf.x = -100;
midleaf.y = 50;
midleaf.x2 = -100;
midleaf.y2 = 50;
midleaf.x3 = -100;
midleaf.y3 = 50;
midleaf.leafColor = color(#50EA80); //greenish blue
//x-25,y+50
midleaf2.display();
midleaf2.display();
midleaf2.x = -125;
midleaf2.y = 100;
midleaf2.x2 = -125;
midleaf2.y2 = 100;
midleaf2.x3 = -125;
midleaf2.y3 = 100;
midleaf2.leafColor = color(#50EA80); //greenish blue
midleaf3.display();
midleaf3.display();
midleaf3.x = -135;
midleaf3.y = 150;
midleaf3.x2 = -135;
midleaf3.y2 = 150;
midleaf3.x3 = -135;
midleaf3.y3 = 150;
midleaf3.leafColor = color(#50EA80);
midleaf4.display();
midleaf4.display();
midleaf4.x = 375;
midleaf4.y = 100;
midleaf4.x2 = 375;
midleaf4.y2 = 100;
midleaf4.x3 = 375;
midleaf4.y3 = 100;
midleaf4.leafColor = color(#50EA80);
midleaf5.display();
midleaf5.display();
midleaf5.x = 400;
midleaf5.y = 150;
midleaf5.x2 = 400;
midleaf5.y2 = 150;
midleaf5.x3 = 400;
midleaf5.y3 = 150;
midleaf5.leafColor = color(#50EA80);
//Flowers
poppy.display();
poppy.move();
daisy.move();
daisy.display();
daisy.petalColor = color (#E5FCF9);
daisy.sunColor = color (#C3F5EE);
//Ellipse behind face
fill(0);
stroke(#FF9900); //orange
strokeWeight(8);
ellipse(350, 325, 500, 500);
//Iris left
strokeWeight(2);
fill(#FCEA3D);
ellipse(325,313,40,40);
//Pupil left
fill(#E8A513);
ellipse(325,313,20,20);
//Highlight left
noStroke();
fill(250);
ellipse(320,308,10,10);
//Highlight2 left
noStroke();
fill(250);
rect(315, 320, 13, 5);
//Iris right
fill(#FCEA3D);
ellipse(470,308,35,35);
//Pupil right
fill(#E8A513);
ellipse(470,308,20,20);
//Highlight right
noStroke();
fill(250);
ellipse(465,303,10,10);
//Highlight2 right
noStroke();
fill(250);
rect(460, 312, 13, 5);
//Face shape outline
strokeWeight(2);
stroke(#398DD1);
line(530, 200, 525, 250);
line(525, 250, 524, 275);
line(524, 275, 500, 400);
line(500, 400, 460, 460);
line(460, 460, 428, 500);
line(428, 500, 400, 520);
line(400, 520, 380, 515);
line(380, 515, 320, 485);
line(320, 485, 270, 450);
line(270, 450, 250, 430);
line(250, 430, 240, 400);
//Right eye
strokeWeight(7);
stroke(#3BF574);
line(450, 300, 455, 295);
stroke(#3BF574);
line(455, 295, 460, 292);
stroke(#3BF574);
line(460, 292, 480, 285);
stroke(#3BF574);
line(480, 285, 500, 282);
stroke(#3BF574);
line(500, 282, 505, 285);
stroke(#C9F7FC);
line(505, 285, 500, 310);
stroke(#C9F7FC);
line(500, 310, 490, 320);
stroke(#C9F7FC);
line(490, 320, 460, 325);
stroke(#C9F7FC);
line(460, 325, 455, 324);
stroke(#C9F7FC);
line(455, 324, 445, 328);
stroke(#C9F7FC);
line(445, 328, 445, 326);
stroke(#3BF574);
line(445, 326, 446, 313);
stroke(#3BF574);
line(446, 313, 450, 300);
//Left eye
strokeWeight(7);
stroke(#3BF574); //greenish blue
line(360, 328, 359, 317);
stroke(#3BF574);
line(359, 317, 357, 310);
stroke(#3BF574);
line(357, 310, 352, 300);
stroke(#3BF574);
line(352, 300, 330, 295);
stroke(#3BF574);
line(330, 295, 318, 293);
stroke(#3BF574);
line(318, 293, 300, 295);
stroke(#3BF574);
line(300, 295, 290, 300);
stroke(#C9F7FC); //whitish blue
line(290, 300, 300, 325);
stroke(#C9F7FC);
line(300, 325, 310, 335);
stroke(#C9F7FC);
line(310, 335, 345, 332);
stroke(#C9F7FC);
line(345, 332, 361, 338);
stroke(#3BF574);
line(361, 338, 360, 328);
//Eye corner left
fill(#D1ABB8);
noStroke();
ellipse(360,335,15,15);
//Eye corner right
fill(#D1ABB8);
noStroke();
ellipse(448,328,15,15);
//Lips
strokeWeight(5);
stroke(#B42842);
line(350, 450, 380, 440);
line(380, 440, 400, 445);
line(400, 445, 420, 438);
line(420, 438, 435, 445);
line(435, 445, 420, 448);
line(420, 448, 400, 458);
line(400, 458, 380, 450);
line(380, 450, 350, 450);
line(350, 450, 342, 446);
line(350, 450, 380, 465);
line(380, 465, 400, 470);
line(400, 470, 412, 466);
line(412, 466, 420, 460);
line(420, 460, 435, 445);
//Brow left
fill(#88E8DC);
noStroke();
triangle(300, 280, 325, 250, 370, 275);
//Brow right
fill(#88E8DC);
noStroke();
triangle(450, 270, 475, 250, 500, 275);
//Hair base
//quad(38, 31, 86, 20, 69, 63, 30, 76);
fill (#88E8DC);
noStroke ();
fill(#C49E81); //brown
quad(200, 400, 250, 380, 230, 700, 180, 720); //under v
fill (#11980B);
quad(200, 300, 250, 280, 230, 380, 180, 400); //next next to left eye
fill (#11980B);
quad(250, 300, 300, 250, 280, 360, 240, 370); //on the right of above
fill (#11980B);
quad(320, 160, 550, 120, 400, 290, 310, 240); //above both eyes
fill (#11980B);
quad(500, 190, 550, 140, 550, 500, 525, 550); //under right of above
fill (#C49E81);
quad(525, 575, 550, 520, 575, 795, 500, 795); //under above
fill (#EDDFD5);
quad(180, 730, 230, 710, 250, 795, 170, 795);
fill (#EDDFD5);
quad(150, 420, 195, 400, 120, 795, 110, 795);
fill (#EDDFD5);
quad(185, 500, 175, 730, 165, 795, 130, 795);
fill (#C49E81);
quad(150, 300, 195, 300, 173, 400, 150, 410);
fill (#11980B);
quad(150, 160, 310, 140, 300, 240, 150, 285);
fill (#EDDFD5); //whitish brown
quad(120, 160, 140, 140, 145, 410, 100, 795);
fill (#EDDFD5);
quad(560, 135, 570, 120, 580, 795, 560, 540);
//Neck
fill(250);
quad(250, 450, 370, 525, 300, 610, 240, 650);
//Chest
quad(240, 660, 300, 620, 400, 650, 260, 795);
quad(410, 650, 505, 680, 490, 795, 270, 795);
//Shoulders
quad(60, 700, 95, 670, 95, 795, 10, 795);
quad(583, 720, 620, 750, 630, 795, 587, 795);
//Branches
fill(#62311F); //brown
//Main branch 1
quad(320, 50, 350, 20, 345, 140, 315, 155);
//Branch arms 1
quad(300, 80, 330, 100, 330, 120, 305, 85);
quad(280, 40, 330, 70, 330, 80, 300, 60);
quad(345, 80, 370, 20, 355, 50, 330, 50);
//Main branch 2
quad(500, 20, 520, 40, 535, 115, 520, 120);
//Branch arms 2
quad(480, 70, 505, 40, 510, 50, 450, 100);
quad(510, 60, 570, 40, 515, 70, 515, 80);
quad(520, 100, 570, 80, 525, 115, 530, 100);
//Main branch 3
quad(150, 50, 175, 60, 200, 150, 160, 155);
//Branch arms 3
quad(160, 60, 200, 60, 230, 80, 180, 70);
quad(100, 100, 160, 120, 170, 130, 80, 115);
//Suns on head
//Sun 1
fill(#F6FF0D); //bright yellow
ellipse(90, 180, 50, 50);
//Sun petals
fill (#B42842); //red
ellipse(50, 170, 20, 20);
fill (#B42842); //red
ellipse(55, 200, 20, 20);
fill (#B42842); //red
ellipse(85, 220, 20, 20);
fill (#B42842); //red
ellipse(115, 210, 20, 20);
fill (#B42842); //red
ellipse(130, 180, 20, 20);
fill (#B42842); //red
ellipse(120, 150, 20, 20);
fill (#B42842); //red
ellipse(95, 140, 20, 20);
fill (#B42842); //red
ellipse(67, 147, 20, 20);
redandyellow.display();
ray2.display();
ray3.display();
}
void mousePressed () {
saveFrame("MidtermProject.png");
}