//Robert Oh
//Section C
//rhoh@andrew.cmu.edu
//Project-04-String-Art
//assigning variables
function setup() {
createCanvas(400, 300);
}
function draw() {
background(0);
strokeWeight(1)
stroke(255, 120, 79)
//creating the top and bottom parts
for (var i = 1; i < 401; i+=10){
line(200, 26, i, 300);
line(200, 274, i, 0);
}
stroke(255, 142, 142)
//creating the left and right parts
for (var i = 1; i < 301; i+=10){
line(33, 150, 400, i);
line(367, 150, 0, i);
}
stroke(255);
//creating the top left and bottom right parts
for (var i = 1; i < 401; i+=12){
line(0, height-(i*3/4), i, 0)
line(i, 300, 400, height - i*3/4);
}
//creating the bottom left and top right parts
//I changed the increment here to be lower to show more depth
for (var i = 1; i < 401; i+=5){
line(0, i*3/4, i, 300);
line(i, 0, 400, i*3/4);
}
}
For this project, I originally started off just experimenting around. When I finally was able to create the “star” figure in the middle, I knew I wanted to add some more flair, and so I included the curves covering the edges of the screen.