/*Curran Zhang
curranz
Project 4
Section A
*/
function setup(){
createCanvas(600,600);
background(75);
var rectH ;
var rectW ;
var smallH ;
var x1 ;
var y1 ;
var x2 ;
var y2 ;
var x3 ;
var y3 ;
var x4 ;
var y4 ;
var l1 ;
}
var radius = 50;
var sx = 500;
var sy = 100;
var angle = 0;
function draw(){
background(0);
rectH = height - mouseY;
rectW = rectH;
smallH = rectH/4;
x1 = width/2 - rectW/4;
y1 = mouseY - 20;
x2 = width/2 - rectW/4;
y2 = mouseY -20;
x3 = width/2 + rectW/4;
y3 = mouseY - 20;
x4 = width/2 + rectW/4;
y4 = mouseY - 20;
l1 = width/2 - rectW/2-4;
//Bridge (RED) Lines
for (var i = 0; i <= 600; i += 30) {
stroke(40);
line(0,i,width/2 - rectH /2,mouseY );
line(600,i,width/2 + rectH /2,mouseY );
}
for (var i = 0; i <= 600; i += 40) {
stroke('red');
line(0,i,width/2 - 10,mouseY );
line(600,i,width/2 + 10,mouseY );
}
for (var i = 0; i <= 240; i += 40) {
stroke('red');
line(i,600,width/2 - 10,mouseY );
line(i,0,width/2 - 10,mouseY );
}
for (var i = 360; i <= 600; i += 40) {
stroke('red');
line(i,600,width/2 + 10,mouseY );
line(i,0,width/2 + 10,mouseY );
}
//Bridge Structure
for (var i = 0; i <= 100; i++) {
stroke(230);
x1 -= 4;
if (x1 < width/2- rectW/2) {x1 = width/2- rectW/2};
y1 += 30;
line(x1,mouseY,width/2 - rectW/2,y1);
}
for (var i = 0; i <= 50; i++) {
stroke(230);
x2 += 4;
if (x2 > width/2 ) {x2 = width/2 };
y2 += 30;
line(x2,mouseY,width/2,y2);
}
for (var i = 0; i <= 100; i++) {
stroke(230);
x3 -= 4;
if (x3 < width/2) {x3 = width/2};
y3 += 30;
line(x3,mouseY,width/2 ,y3);
}
for (var i = 0; i <= 50; i++) {
stroke(230);
x4 += 4;
if (x4 > width/2 + rectW/2) {x4 = width/2 + rectW/2};
y4 += 30;
line(x4,mouseY,width/2+rectW/2,y4);
}
for (var i = 50; i <= 200; i++) {
stroke(230);
l1+=4;
if (l1 > width/2 + rectW/2) {l1 = width/2 + rectW/2};
line(l1,mouseY-smallH,l1, mouseY);
}
//Sun
for (var i = 0 ; i <360; i+=8) {
push();
translate(500, 100);
rotate(radians(angle));
stroke(255,200,21);
line(0,0,50,0);
line(0,0,radius * cos(radians(i)),radius* sin(radians(i)));
pop();
angle = angle + .01;
}
}
At the beginning of the project, when I first thought of string art, I thought about the Brooklyn Bridge. The Brooklyn Bridge is supported through cables and create a wild variety of designs at different locations. Thus, I began making creating the drawing similarly to how to bridge itself is created.