/* Submitted by: Michal Luria
Section A: 9:00AM - 10:20AM
mluria@andrew.cmu.edu
Assignment-05-B
*/
var marg = 20; //margin for background dots
var start = 195; //starting point of diamond
var step = 100; //margin space in big diamond
var smallStepX = 50; //X margin space in small diamond
var smallStepY = 80; //Y margin space is small diamond
function setup() {
createCanvas(783, 540);
background(236,229,206);
noStroke();
for (var y = 0; y < height/20; y++) {
if(y % 2 == 0){
//draw background dots
for (var x = 0; x < width/20; x++) {
fill(244,142,121);
ellipse(marg*x, 10 + marg*y, 3, 3);
}
} else {
//alternate dot background
for (var x = 0; x < width; x++) {
fill(244,142,121);
ellipse(marg*x + marg/2, 10 + marg*y, 3, 3);
}
}
}
fill(197, 224, 220);
for (var i = 0; i < 5; i++) {
//draw big diamond
quad(i*start, height/2, i*start+step, height/4,
i*start+(2*step), height/2, i*start+step, height/4*3);
//draw squares in diamonds
push();
fill(224, 142, 121);
rect((i*start + i*start+step)/2, (height/2+height/4)/2, 100, 130);
pop();
//draw small diamond
quad(i*start+smallStepX, height/2, i*start+step, height/4+smallStepY,
i*start+(2*step)-smallStepX, height/2, i*start+step, height/4*3-smallStepY);
//draw center circle
push();
fill(231,202,145);
ellipse(i*start+2*smallStepX, height/2, 50, 50);
pop();
}
noLoop();
}
In the process I wanted to create a wallpaper that I would enjoy (for my computer) as well. I wanted to use some geometrical/tribal inspired forms and organic colors for this project. Starting with an initial sketch (attached), programming the pattern and previewing it allowed me to iterate and modify according to my preference and esthetic taste as I went.