jwchou-project05-wallpaper

sketch 285

// Jackie Chou
// Section E
// jwchou@andrew.cmu.edu
// Project-05-Wallpaper

function setup() {
    createCanvas(480, 480);
    //background(161, 209, 255);
    background(164, 225, 219);

    var move;
    var r;
    var g;
    var b;
    var num;

    var cloudX = random(0, width); //random location of cloud 1
    var cloudY = random(0, height);

    var cloudX1 = random(0, width); //random location of cloud 2
    var cloudY1 = random(0, height);

    var cloudX2 = random(0, width); //random location of cloud 3
    var cloudY2 = random(0, height);

    var cloudX3 = random(0, width); //random location of cloud 4
    var cloudY3 = random(0, height);

    var cloudX4 = random(0, width); //random location of cloud 5
    var cloudY4 = random(0, height);

    var cloudX5 = random(0, width); //random location of cloud 6
    var cloudY5 = random(0, height);

    //cloud 1
    noStroke();
    fill(255, 255, 255, 80);
    ellipse(cloudX, cloudY, 70, 50);
    ellipse(cloudX + 15, cloudY - 10, 60, 40);
    ellipse(cloudX + 30, cloudY + 15, 40, 30);
    ellipse(cloudX + 35, cloudY, 50, 30)

    //cloud 2
    ellipse(cloudX1, cloudY1, 100, 70);
    ellipse(cloudX1 + 15, cloudY1 - 10, 70, 50);
    ellipse(cloudX1 + 30, cloudY1 + 15, 80, 50);
    ellipse(cloudX1 + 35, cloudY1, 50, 30)
 
    //cloud 3
    ellipse(cloudX2, cloudY2, 70, 50);
    ellipse(cloudX2 + 15, cloudY2 - 10, 50, 30);
    ellipse(cloudX2 + 30, cloudY2 + 15, 30, 10);
    ellipse(cloudX2 + 35, cloudY2, 40, 20)

    for(var y = 0; y < 6; y++) {
        if (y % 2 == 0) { //is row is even
            move = 45; //offset by 35
            r = 222; //pink
            g = 147;
            b = 142;
            num = 4; //have four planes

        } else {
            move = 0; //if row is odd, offset by zero
            r = 202; //purple
            g = 151;
            b = 222;
            num = 5; //have five plaes
        }
       
        for(var x = 0; x < num; x++) {
            xPos = x * 90 + move + 25; // x Position + offset
            yPos = y * 75 + 20; // y Position

            noStroke();
            fill(190);
            ellipse(xPos + 40, yPos + 40, 70, 11); //wings
            ellipse(xPos + 40, yPos + 20, 35, 8); //horz stabilizer
            fill(108, 190, 225);
            ellipse(xPos + 40, yPos + 40, 17, 45); //fuselage
            ellipse(xPos + 57, yPos + 45, 6, 15); //left engine
            ellipse(xPos + 23, yPos + 45, 6, 15); //right engine
            fill(0);
            ellipse(xPos + 23, yPos + 50, 10, 2); //right propeler
            ellipse(xPos + 57, yPos + 50, 10, 2); //left propeller
            fill(190);
            ellipse(xPos + 40, yPos + 15, 5, 17); //tail
            fill(0);
            beginShape(); //cockpit
            vertex(xPos + 35, yPos + 50);
            vertex(xPos + 40, yPos + 57);
            vertex(xPos + 45, yPos + 50);
            vertex(xPos + 45, yPos + 45);
            vertex(xPos + 40, yPos + 50);
            vertex(xPos + 35, yPos + 45);
            vertex(xPos + 35,yPos +  50);
            endShape();

    }

    //cloud 4
    noStroke();
    fill(255, 255, 255, 50);
    ellipse(cloudX3, cloudY3, 70, 50);
    ellipse(cloudX3 + 15, cloudY3 - 10, 60, 40);
    ellipse(cloudX3 + 30, cloudY3 + 15, 40, 30);
    ellipse(cloudX3 + 35, cloudY3, 50, 30)

    //cloud 5
    ellipse(cloudX4, cloudY4, 100, 70);
    ellipse(cloudX4 + 15, cloudY4 - 10, 70, 50);
    ellipse(cloudX4 + 30, cloudY4 + 15, 80, 50);
    ellipse(cloudX4 + 35, cloudY4, 50, 30)
 
    //cloud 6
    ellipse(cloudX5, cloudY5, 70, 50);
    ellipse(cloudX5 + 15, cloudY5 - 10, 50, 30);
    ellipse(cloudX5 + 30, cloudY5 + 15, 30, 10);
    ellipse(cloudX5 + 35, cloudY5, 40, 20)

}
}

For this project, I was inspired by a sweater I used to own that had a bunch of planes on it. I wanted to create something in the same vein, and I also wanted to incorporate a few random elements, which became a few clouds in the pattern that have random coordinates.

Leave a Reply