Alexandra Kaplan – Project 5 – Wallpaper

sketch


function setup(){
	createCanvas (480, 480);
	background (170, 220, 250);
	strokeWeight(0);
	noLoop();
}

function draw(){

	//makes a grid for the right facing balloons
    for(var x1 = 70; x1 < width; x1 += 250){
    	for(var y1 = 50; y1 < height; y1 += 230){
	        airBalloonRight(x1, y1);
    	}
    }

    //makes a grid for the left facing balloons
    for(var x2 = 170; x2 < width; x2 += 250){
    	for(var y2 = 150; y2 < height; y2 += 230){
	        airBalloonLeft(x2, y2)
	    }
	}

    //makes a grid of the clouds
	for(var x3 = 170; x3 < width; x3 += 250){
        for(var y3 = 50; y3 < height; y3 += 230){
	       cloud(x3, y3);
        }
	}

	//makes a grid of the sun
	for(var x4 = 50; x4 < width; x4 += 250){
        for(var y4 = 160; y4 < height; y4 += 230){
	       sun(x4, y4);
	   }
	}

}

function airBalloonRight(x, y){ //draws the right facing balloons
	push();
	translate(x, y);
    rotate(radians(30));
   
    //balloon
	fill(250, 90, 90);
    ellipse(0, 0, 60, 55);
    quad(-30, 5, 30, 5, 6, 38, -6, 38);
   
    //basket
    fill(150,110,90);
    rect(-5, 45, 10, 8);
   
    //ballon decor
    strokeWeight(2);
    stroke(200, 60, 60);
    line(18, 20, -18, 20);
    line(28, 0, -29, 0);
    line(19, -20, -19, -20);
    
    //basket connectors
    strokeWeight(1);
    stroke(150,110,90);
    line(-15, 25, -5, 45);
    line(14, 25, 4, 45);
    
    pop();

}

function airBalloonLeft(x, y){ // draws the left facing balloons
	push();
	translate(x, y);
    rotate(radians(-30));

    // balloon
	fill(250, 90, 90);
    ellipse(0, 0, 60, 55);
    quad(-30, 5, 30, 5, 6, 38, -6, 38);

    // basket
    fill(150,110,90);
    rect(-5, 45, 10, 8);

    // basket connectors
    strokeWeight(1);
    stroke(150,110,90);
    line(-15, 25, -5, 45);
    line(14, 25, 4, 45);

    //ballon decor
    strokeWeight(2);
    stroke(200, 60, 60);
    line(18, 20, -18, 20);
    line(28, 0, -29, 0);
    line(19, -20, -19, -20);
    
    pop();

}

function cloud (x, y){ // draws the cloud
	push();
    fill(250);
    translate(x, y);
    ellipse(5, -5, 40, 35);
    ellipse(28, -2, 40, 28);
    rect(-28, -5, 85, 20, 10);
    pop(); 
}

function sun(x, y){ // draws the sun
	push();
    translate(x,y)
    push();
    for(var r = 0; r < 800; r += 90){ //rotates the rays around the center ellipse
    	rays();
    	rotate(radians(r));
    }
    pop();
    ellipse(0, 0, 30, 30)
    fill(245, 225, 10)
    ellipse(0, 0, 30, 30)
	pop();
}

function rays(x, y) { // draws the rays
	fill(250, 200, 10);
	triangle(0, 13, -30, 25, -15, 0);
	triangle(-5, 10, - 30, 0, -5, -10)
}



















I had a lot of fun with this project, coming up with a repeating design by using for() loops and declaring my own functions. I came up with the idea of hot air balloons because I thought that they would be cute and simple. I like my final design, I think it would be good for a backpack, computer desktop screen, or wallpaper for a child’s room. In future projects, I will work on incorporating more variables into the drawings of the specific objects.

Leave a Reply