Gretchen Kupferschmid – Project 02 – Variable Face

sketch

var eyeSize = 7.588;
var mouthWidth = 20.166;
var mouthHeight = 17.656; 
var flowerSize = 226.69;
var flowerColor = 208;
var blushHeight = 5.565;
var cactusHeight = 217;
var cactusArm = 75.357;
var cactusColor = 119; 

function setup() {
    createCanvas(480, 640);
}
 function draw (){
    background(199, 241, 242);
    
    //ground
    fill(193, 173, 139);
    noStroke();
    rect(0, 359.79, 480, 280.209);
    
    //ground shadow
    fill(142, 123, 94);
    noStroke();
    ellipse(142.96, 426.9, 217.735, 29.888);
     
    //cactus shadow
    fill(93, 135, 56);
    noStroke();
    ellipse (209.98, 426.9, 80.461, 37.36);
    beginShape();
    curveVertex (209.16, 437.58);
    curveVertex (170, 430.95);
    curveVertex (167.32, 397.88);
    curveVertex (164.59, 363.31);
    curveVertex (156, 248.85);
    curveVertex (173, 148.38);
    curveVertex (224, 131.63);
    curveVertex (262, 204.89);
    curveVertex (262, 303.27);
    curveVertex (251, 392.23);
    curveVertex (248, 430.95);
    curveVertex (209.16, 437.58);
    endShape();
    beginShape();
    curveVertex (189, 359.09);
    curveVertex (171, 358.09);
    curveVertex (145, 352.09);
    curveVertex (113, 337.09);
    curveVertex (88, 272.09);
    curveVertex (112, 247.09);
    curveVertex (137, 268.09);
    curveVertex (189, 317.09);
    curveVertex (189, 359.09);
    endShape();
    beginShape();
    curveVertex (233, 294.73);
    curveVertex (231, 260.73);
    curveVertex (255.96, 226.97);
    curveVertex (278, 204.73);
    curveVertex (308, 192.73);
    curveVertex (334, 219.73);
    curveVertex (312, 272.73);
    curveVertex (275, 297.73);
    curveVertex (252.77, 301.71);
    curveVertex (233, 294.73);
    endShape();
     
    //cactus main body
    fill(cactusColor, 173, 78);
    noStroke();
    beginShape();
    curveVertex (217.38, 430.71);
    curveVertex (184.74, 422.24);
    curveVertex (179.02, 340.31);
    curveVertex (172.99, 248.24);
    curveVertex (187.26, 152.24);
    curveVertex (230.06, 136.24);
    curveVertex (261.96, 206.24);
    curveVertex (261.96, 300.24);
    curveVertex (252.72, 385.24);
    curveVertex (250.21, 423.24);
    curveVertex (217.38, 430.71);
    endShape();
    beginShape();
    curveVertex (189, 350);
    curveVertex (171, 349);
    curveVertex (152.15, 345.15);
    curveVertex (145, 343);
    curveVertex (113, 328);
    curveVertex (93.55, 304.65);
    curveVertex (88, 263);
    curveVertex (112, 238);
    curveVertex (137, 259);
    curveVertex (182.98, 298.1);
    curveVertex (189, 308);
    curveVertex (197.95, 333.5);
    curveVertex (189, 350);
    endShape()
    beginShape();
    curveVertex (239, 274);
    curveVertex (237, 240);
    curveVertex (261.96, 206.24);
    curveVertex (284, 184);
    curveVertex (314, 172);
    curveVertex (340, 199);
    curveVertex (318, 252);
    curveVertex (281, 277);
    curveVertex (260.25, 280.94);
    curveVertex (239, 274);
    endShape();
    ellipse (114.46, 276.75, 57, 79.492);
    ellipse (307.36, 209.41, 67.402, cactusArm);
    ellipse (220.44, cactusHeight, 98.039, 190);
    
    //flower
    fill(214, 171, flowerColor);
    noStroke();
    beginShape();
    curveVertex (106.31, 246.7);
    curveVertex (96.93, 241.91);
    curveVertex (94.92, 230.34);
    curveVertex (98.63, flowerSize);
    curveVertex (100.55, 230.61);
    curveVertex (106.1, 236.04);
    curveVertex (106.1, 233.22);
    curveVertex (107.38, flowerSize);
    curveVertex (113.13, flowerSize);
    curveVertex (117.82, 234.52);
    curveVertex (120.38, 229.52);
    curveVertex (126.78, flowerSize);
    curveVertex (127.84, 233.65);
    curveVertex (121.66, 243.87);
    curveVertex (115.37, 246.79);
    curveVertex (106.31, 246.7);
    endShape();
     
    //eyes black part
    fill(0);
    noStroke();
    ellipse (206.25, 209.41, eyeSize, eyeSize);
    ellipse (229.96, 209.41, eyeSize, eyeSize);
    
    //eyes white part
    fill(255);
    noStroke();
    ellipse (207.02, 208.28, 3.026, 3.026);
    ellipse (230.96, 208.28, 3.026, 3.026);
    
    //blush cheeks
    fill(193, 118, 148);
    noStroke();
    ellipse (198.2, 222.36, 7.791, blushHeight);
    ellipse (236.59, 222.36, 7.791, blushHeight);
     
    //mouth
    fill(0);
    noStroke(); 
    arc (219.36, 227.43, mouthWidth, mouthHeight, 0, PI );
     
 }

function mousePressed () {
    eyeSize = random(6.5, 12);
    mouthWidth = random(11, 44);
    mouthHeight = random(10, 25);
    flowerSize = random(220, 230);
    flowerColor = random(80, 255);
    blushHeight = random(4, 9);
    cactusHeight = random(190, 225); 
    cactusArm = random(65, 120);
    cactusColor = random(0, 150);
}

Leave a Reply