//Ashley Chan
//Secion C
//ashleyc1@andrew.cmu.edu
//Project-05-Wallpaper
var slant; //diagonal angle of line
var offsetX; //line space of x
var x; //x-value of gold lines
//setup is executed once at the launch
function setup() {
createCanvas(400, 400);
background(10, 51, 80);
x = 0;
slant = 500;
offsetX = -800;
}
function draw() {
drawDiagonalLines();
drawMiddleGoldLines();
drawTopGoldLines();
drawBottomGoldLines();
drawOrnaments();
}
function drawDiagonalLines() {
//outer white diagonal lines going up
for (var i = 0; i <= width; i = i + 1){
stroke(219, 179, 2);
line (offsetX, 0, offsetX + slant, height);
line(offsetX, 0, offsetX - slant, height);
offsetX += 200;
}
}
function drawMiddleGoldLines() {
for (var x = 0; x <= 50; x += 1){
for (var y = 240; y <= height; y += 40){
stroke(219, 179, 2);
strokeWeight(1);
//cone part of lines
line (x, 240, (x + slant) - 450, height/5);
line (x, 240, (x + slant) - 550, height/5);
line (x - 50, 240, (x + slant) - 600, height/4);
line (x - 150, 240, (x + slant) - 600, height/4);
//top of diamond cones
line (x - 100, 280, (x + slant) - 550, 240);
line (x - 100, 280, (x + slant) - 650, 240);
line (x - 150, 240, (x + slant) - 450, height/5);
line (x - 50, 240, (x + slant) - 750, height/5);
//diamond criss-cross
line (x, 40, (x + slant) - 450, height/5);
line (x - 50, 80, (x + slant) - 500, height/10);
line (x, 120, (x + slant) - 450, height/5);
line (x, 120, (x + slant) - 550, height/5);
x += 200;
}
}
}
function drawTopGoldLines() {
push();
translate(0, -158);
drawMiddleGoldLines();
pop();
}
function drawBottomGoldLines() {
push();
translate(0, 160);
drawMiddleGoldLines();
pop();
}
function drawOrnaments() {
for (x=0; x <= width; x = x + 200){
for (y = 0; y <= height; y = y + 160){
fill(255);
strokeWeight(2);
ellipse(x, y, 10, 10);
ellipse(x + 100, y + 80, 10, 10);
//petals
ellipse(x, y - 20, 10, 20);
ellipse(x, y + 20, 10, 20);
ellipse(x - 20, y, 20, 10);
ellipse(x + 20, y, 20, 10);
}
}
}
I tend to enjoy wallpapers/designs with a subtle, floral element over a geometric background. My process for this project was fairly experimental and non-linear. I initially sketched out some diagonals for myself and then figured I’d just play with p5 until I got a floral shape that I enjoyed. In reality, I had fun altering the start and end points of the diagonal lines so much so that I was creating different layering effects with them. I decided then that the floral element that would sit on top had to be very simple otherwise the pattern would be overloaded. Overall, my final result stemmed from a lot of playing and deviating from my initial sketch. I’m content with the final design and if I were to have this printed on fabric, I would sew and wear it.