//Yugyeong Lee
//Section A (9:00AM)
//yugyeonl@andrew.cmu.edu
//Project 05
var len = 30;
var diam = 5;
var offset = 5;
function setup() {
createCanvas(524, 524);
}
function draw() {
background(225, 155, 180);
stroke(224, 112, 155);
noLoop();
for (var y = 0; y < height; y += 140) {
for (var x = 0; x < width; x += 140) {
flower(x, y);
}
}
for (var y = 70; y < height; y += 140) {
for (var x = 70; x < width; x += 140) {
flower(x, y);
}
}
for (var y = 0; y < height; y += 140) {
for (var x = 70; x < width; x += 140) {
push();
translate(x, y);
noFill();
symbol(0, 0);
angleMode(DEGREES);
rotate(90);
symbol(0, 0);
rotate(90);
symbol(0, 0);
rotate(90);
symbol(0, 0);
pop();
}
}
for (var y = 70; y < height; y += 140) {
for (var x = 0; x < width; x += 140) {
push();
translate(x, y);
noFill();
symbol(0, 0);
angleMode(DEGREES);
rotate(90);
symbol(0, 0);
rotate(90);
symbol(0, 0);
rotate(90);
symbol(0, 0);
pop();
}
}
}
function symbol (x,y) {
push();
translate(x, y);
strokeWeight(5);
beginShape();
vertex(-len - offset*2, -offset);
vertex((-len + offset)/2, -offset);
vertex((-len + offset)/2, -len + offset * 2);
vertex(-len + offset*2, -len + offset*2);
vertex(-len + offset*2, (-len + offset)/2);
vertex(-len, (-len + offset)/2);
vertex(-len, -len);
vertex(-offset/2, -len);
vertex(-offset/2, -offset);
endShape();
pop();
}
function flower (x, y) {
push();
translate(x, y);
rectMode(CENTER);
noFill();
strokeWeight(5);
rect(0, 0, 2*len, 2*len);
strokeWeight(2);
line(0, -len, 0, len);
line(-len, 0, len, 0);
angleMode(DEGREES);
rotate(45);
fill(224, 112, 155);
ellipse(0, len, diam, diam);
noFill();
quad(0, 0, -len/2, 0, -2*len/3, -2*len/3, 0, -len/2);
rotate(90);
fill(224, 112, 155);
ellipse(0, len, diam, diam);
noFill();
quad(0, 0, -len/2, 0, -2*len/3, -2*len/3, 0, -len/2);
rotate(90);
fill(224, 112, 155);
ellipse(0, len, diam, diam);
noFill();
quad(0, 0, -len/2, 0, -2*len/3, -2*len/3, 0, -len/2);
rotate(90);
fill(224, 112, 155);
ellipse(0, len, diam, diam);
noFill();
quad(0, 0, -len/2, 0, -2*len/3, -2*len/3, 0, -len/2);
pop();
}
I was inspired by Korean traditional pattern to create this wallpaper. Flower and the symbol are both important symbols in Buddhism which dominated ancient Korean times.