Denise Jiang-Project 05

sketch

function setup() {
    createCanvas(500,600);
}

function draw() {
	background(230);
		for (var y1=-150; y1<height+120; y1=120+y1){
			for(var x1=0; x1<width+120; x1++){
				var x2=x1-30;
				var x4=x1+30;
				var w=40;
				var yspacing=30;
				var y2=y1+yspacing;
				var y3=y2+yspacing;
				var y4=y3+2*yspacing;
				var y5=y4+yspacing;
				noStroke();
				fill(193, 232, 242);
				quad(x1,y2,x2,y4,x1,y5,x4,y3);//blue
				x1+=100;
				x2+=100;
				x4+=100;
				fill(242, 238, 193);
				quad(x4-100,y3,x1,y2,x2,y4,x1-100,y5);//yellow
				fill(242, 209, 193)
			    quad(x1-100,y2,x2,y1,x1,y2,x4-100,y3);//pink
			}
		}
	println();
	noLoop();

}


Using nested loops, I made this seamless pattern by drawing quadrilaterals and create an illusion of boxes.

Leave a Reply