// Shariq M. Shah
// Section C
// shariqs@andrew.cmu.edu
// Project - 05
function setup() {
createCanvas(640, 400);
background(200, 50, 0);
noStroke();
var w = 60;
var h = 60;
for (var y = 0; y < height; y ++) {
// using modulus operator to determine even or odd row
for (var x = 0; x < width; x ++) {
// using spacing multipliers to get accurate spacing
var py = y * h;
var px = x * w;
stroke(180, 200 - py * 0.5, 300 - py * 0.5);
strokeWeight(2)
noFill();
rectMode(CENTER);
rect(px, py, 50, 50);
//coinciding geometries based on positions by changing rectMode to center
//applying gradient to wallpaper
stroke(180, 200 - py * 0.5, 300 - py * 0.5);
rect(px, py, 35, 35);
ellipse(px, py, 50, 50);
stroke(200, 30, 50);
ellipse(px, py, 60, 60);
}
}
noLoop();
}
In this project, I explored using nested for loops to create a wallpaper from coinciding geometries, which created interesting overlapping shapes. By doing this and applying a color gradient, the different geometries created through the for loop develop into an interesting pattern design.