Sarita Chen – Project 04 – String Art

sketch

function setup() {
    createCanvas(640, 480);
   
}

function draw() {
	 background(0); // black.

	 var sizeV = 20; //Variable for the increment.

	 
	
	 strokeWeight(1.5);
	 stroke(180,180,255); //Blue
	 for(var b = 0; b < 50; b++)
	 	line(b*sizeV,height,20,b); // Blue lines 


	 stroke(100,255,255); // Teal
	 for(var r = 5; r < 20; r++)
	 	line(r*sizeV,1,640,r*20); // Teal lines 

	 stroke(200,140,255); //Pink
	  for(var g = 0; g < 40; g++)
	 	line(g*sizeV,480,1,g*10); // Pink lines 

	 stroke(255,180,180); //Purple
	  for(var y = 0; y < 50; y+=2)
	 	line(y*sizeV,height,480,y*2); // Purple lines 

	  stroke(255,180,255); //Lavender
	  for(var y = 0; y < 50; y+=2)
	 	line(y*sizeV,height,300,-y*2); // Lavender lines

  	 stroke(150,230,255);
	 fill(150,230,255);
	 ellipse(width/2,height/2,100,100);

	 // Just for added effect.
	 if (mouseIsPressed) {
	 	ellipse(random(50,150),100,20,20);
	 	ellipse(random(380,400),400,50,50);
	 	ellipse(random(200,300),300,20,20);
	 	ellipse(random(100,200),400,50,50);
	 	ellipse(random(50,100),200,50,50);
	 	ellipse(random(400,460),100,20,20);
	 	ellipse(random(50,150),20,20,20);
	 }
  
}

(Please click.)

At first I wanted to have the strings coming out from the four corners of the canvas, but to me it was kind of boring so I just randomly placed them instead. I had some difficulty figuring out how to get the strings to curve in the beginning. My goal was to make the circle look like it was in a room of string.

Leave a Reply