// Emmanuel Nwandu
// enwandu@andrew.cmu.edu
// Section D
// Project-05-Wallpaper
cirY = 40; // Initial yposition of circle that start the columns
cirX = 40; // Initial xposition of circles that start the row
cSize = 80; // Diameter fo the circles
spacey = 20; // Controls vertical spacing betwen the circles
spacex = 20; // Controls horizontal spacing between the
function setup() {
createCanvas(480, 480);
}
function draw() {
background(0);
// Draws a series of geometry in relation to each other
// that fill the canvas
for (var y = 0; y < height; y+=2.5){
for(var x = 0; x < width; x+=2.5){
var cy = cirY + y * spacey;
var cx = cirX + x * spacex;
noFill();
// Controls stroke color based on position of circle
stroke(cx, cy -100, cx + cy);
strokeWeight(2);
// Draws cirles that intersect with each other
ellipse(cx - cSize/2, cy - cSize/2, cSize, cSize);
rectMode(CENTER);
noStroke();
// Controls the color of the rectangle based on its position; matches the circles
fill(cx, cy - 100, cx + cy);
// Draws rectangle at the center of each circle
rect(cx - cSize/2, cy - cSize/2, 15, 15);
// Draws a small black dot at the center of each rectangle
fill(0);
ellipse(cx - cSize/2 ,cy-cSize/2 , 5, 5);
}
}
}
When I thought of wallpaper, my mind initially went to the ugly stuff you’d see on a grandparents wall in a movie or something. For this project, I was aiming for the opposite. My first pass at the code was essentially what I was trying to avoid; ugly wallpaper. Since I had initially had the intersecting circles as one color, i decided it would be interesting if they change depending on their position. After this I decided to accent the center of these circles, giving it a little more character.
// Emmanuel Nwandu
// enwandu@andrew.cmu.edu
// Section D
// Project-05-Wallpaper
cirY = 40; // Initial yposition of circle that start the columns
cirX = 40; // Initial xposition of circles that start the row
cSize = 80; // Diameter fo the circles
spacey = 20; // Controls vertical spacing betwen the circles
spacex = 20; // Controls horizontal spacing between the
function setup() {
createCanvas(480, 480);
}
function draw() {
background(0);
// Draws a series of geometry in relation to each other
// that fill the canvas
for (var y = 0; y < height; y+=2.5){
for(var x = 0; x < width; x+=2.5){
var cy = cirY + y * spacey;
var cx = cirX + x * spacex;
noFill();
// Controls stroke color based on position of circle
stroke(cx, cy -100, cx + cy);
strokeWeight(2);
// Draws cirles that intersect with each other
ellipse(cx - cSize/2, cy - cSize/2, cSize, cSize);
rectMode(CENTER);
noStroke();
// Controls the color of the rectangle based on its position; matches the circles
fill(cx, cy - 100, cx + cy);
// Draws rectangle at the center of each circle
rect(cx - cSize/2, cy - cSize/2, 15, 15);
// Draws a small black dot at the center of each rectangle
fill(0);
ellipse(cx - cSize/2 ,cy-cSize/2 , 5, 5);
}
}
}