William Su – Project 04 – String Art

I just made a rainbowy web of strings that changes colors depending on mouseX and mouseY. Credit to the person that utilized rotate and translate to move stuff around, it made things a lot simpler to think about.

sketch

// William Su
// Section E
// wsu1@andrew.cmu.edu
// Project 04

function setup () {
  createCanvas(400, 300);
  background(0);
  strokeWeight(0.5);
}

function draw () {
  for (var x = 0; x <= 50; x += 2) {
    var1 = x 
    var2 = x * 10
    b = constrain(var2, 0, (3 * width) / 5);

    //bottomleft
    stroke(mouseX, 0, 50);
    line(0, var2 + height / 2, var2, height);

    //topleft
    push();
    translate(300, 0);
    rotate(radians(90));
    stroke(mouseY, 0, mouseX);
    line(0, var2 + height / 2, var2, height);
    pop();

    //topright
    push();
    translate(400, 300);
    rotate(radians(180));
    stroke(mouseY, mouseX, 50);
    line(0, var2 + height / 2, var2, height);
    pop();

    //bottom right
    push();
    translate(100,300);
    rotate(radians(270));
    stroke(mouseX, mouseY, 50);
    line(0, var2 + height / 2, var2, height);
    pop();

    //2ndCurveTopRight
    stroke(50,mouseX, mouseY);
    line(width * 1.2, var2, var2 /2, 0);

    //2ndCurveBottomLeft
    push();
    translate(400, 300);
    rotate(radians(180));
    stroke(50,mouseY, mouseX);
    line(width * 1.2, var2, var2 /2, 0);
    pop();
  };
}

Monica Chang – Project 04 – String Art

sketch

function setup() {
  createCanvas(400, 300);
}

function draw() {
  // changing background color based on mouse position
  background( mouseX, mouseY, 245);
    
  // creates pattern on top right
  
  for (var i = 0; i < 300; i++) {
      strokeWeight(0.5); // for thin lines
    
      var x1 = width - i * 5; // x1 for curve 1
      var x4 = width + 50; // x1 for curve 4
    
      var y1 = height - i * 5; // y1 for curve 1
      var y2 = height + i * 50; // y1 for curve 2
      var y3 = height - i * 6; // y2 for curve 3
      var y2y4 = height - i * 15; // y2 for curve 4
      var y1y4 = height - i; // y1 for curve 4

      //curve #1
      stroke("red");
      line(x1, mouseY, mouseX, y1); 
    
      //curve #2
      stroke("blue");
      line(0, y2, x1, mouseY); 
      
      //curve #3
      stroke(255);
      line( x1, mouseY, 0, y3);
      
      // curve #4
      stroke("yellow");
      line(x4, height - i, mouseX, y2y4); 
    }
      

  
  
}

This project allowed me to better understand the way loops can be used. I may have struggled but I am becoming more comfortable with the concept of loops and what I can do with them. I had lots of fun integrating color and design as I grew more familiar with the concept of for loops and “i”.

SooA Kim – 04 – String-Art


sketch

For this assignment, I tried to create this abstract wave forms.  Then, I ended up also attempting to make some symmetrical lines to understand better how line coordinates work using loop functions. It was very confusing, I would need more practice to get used to it.

/* SooA Kim
Section D
sookim@andrew.cmu.edu
Assignment 04 -String Art */


function setup() {
    createCanvas(400, 300);
}

function draw() {
    background(0);

    for (var i = 0; i < 200; i+= 2) {
        stroke("gold");
        strokeWeight(1);
        line(i, height, 0, 5*i);
        stroke("red");
        line(4*i, height, 0, 4*i);
        stroke("pink");
        line(7*i, height, 0, 3*i);
        stroke("blue")
        line(10*i, height, 0, 2*i);
        stroke("purple");
        line(13*i, height, 0, 1.5*i);
    }
    
    for (var i = 0; i < 100; i+= 10) {
        stroke(255, 109, 0);
        strokeWeight(1);
        line(i/4, i, i*4, height/2);
        line(i/4, height - i, i*4, height/2);
        stroke(mouseX, 255, mouseY);
        strokeWeight(mouseX);
        line(width - (i*2), 0, i * 2, height);
        line(width - (i*2), height, (i*2), 0);

    }

}



Nawon Choi— Project 04 String Art

nawon-project-04

// Nawon Choi
// nawonc@andrew.cmu.edu
// Section C
// Project 04 String Art


var a = 0;
var b = 300;
var c = 400;
var amt = 50;

var r = 500;
var x;
var y;
var x1;
var y1;

function setup() {
    createCanvas(300, 400);
    background("black");
}

function draw() {
    // got help getting the points along a circle: 
    // (lines 27, 32, 33)
    // https://stackoverflow.com/questions/5300938/calculating-the-position-of-points-in-a-circle
    var slice = 2 * PI / amt;
    for (let i = 0; i < amt; i++) {
        // draw lines from points along the circle,
        // to points along the edge of the canvas
        var angle = slice * i;
        x = r * cos(angle) + a;
        y = r * sin(angle) + c;
        stroke("#37393b");
        line(x, y, i * 20, a);
    }

    // green and yellow lines
    for (let i = 0; i < (amt / 2); i++) {
        stroke("green");
        line(a, a, i * 20, c);
        var angle2 = slice * i * 2;
        x1 = r * cos(angle2) + a;
        y1 = r * sin(angle2) + c;
        stroke("yellow");
        line(x1, y1, i * 25, c);
    }

    // make lines that follow the mouse
    stroke("#a3afb5");
    line(b, a, mouseX, mouseY);
}

For this project, I mainly tried to experiment with different ways lines could be drawn. I initially played around with the way lines splay outward from a circle. I amplified this by playing around with the variables, magnifying the size of the circle and having it go off the canvas, creating the gray lines in the background. I added some green and yellow lines to add some visual interest, then added the lighter gray lines to add an interactive element.

Sean Leo – Project 04 – String Art


This learning curve on this was step (pun intended) but once I realized I could copy and rotate the different parts it was smooth sailing.

sleo-project04

//Sean B. Leo
//sleo@andrew.cmu.edu
//Section C
//Project 04
var x1 = 0;
var y1 = 0;
var x2 = 0; 
var y2 = 350;
var x2step = 11; 
var y1step = 4;

function setup() {
  createCanvas(400, 300);
  background(0);
  strokeWeight(.6);
}

function draw() {
//first curve
stroke('blue');
for(var i=0; i<1; i++){
    line(x1, y1, x2, y2);
    y1+=y1step;
    x2+=x2step;
}
//blue curve translated, rotated and colored
push();
stroke('red');
translate(300, 0);
rotate(radians(90));
for(var i=0; i<1; i++){
    line(x1, y1, x2, y2);
    y1+=y1step;
    x2+=x2step;
}
pop();
//blue curve translated, rotated and colored 2
push();
stroke('green');
translate(400, 300);
rotate(radians(180));
for(var i=0; i<1; i++){
    line(x1, y1, x2, y2);
    y1+=y1step;
    x2+=x2step;
}
pop();
//blue curve translated, rotated and colored 3
push();
stroke('yellow');
translate(100, 300);
rotate(radians(270));
for(var i=0; i<1; i++){
line(x1, y1, x2, y2);
y1+=y1step;
x2+=x2step;
}
pop();
}
 
  

  
  

  
  

  

Raymond Pai-Project-04

sketch

//Raymond Pai
//Section D
//rpai@andrew.cmu.edu
//Project 04

var rx1;
var ry1;
var rx2;
var ry2;

var lx1;
var ly1;
var lx2;
var ly2;

var bx1;
var by1;
var bx2;
var by2;

var tx1;
var ty1;
var tx2;
var ty2;

function setup() {
    createCanvas(400, 300);
    //initiate r curve
    rx1 = 0;
    ry1 = -150;
    rx2 = 0;
    ry2 = height;

    //initiate l curve
    lx1 = 20;
    ly1 = -150;
    lx2 = 20;
    ly2 = height;

    //initiate b curve
    bx1 = -20;
    by1 = -150;
    bx2 = -20;
    by2 = height;

    //initiate l curve
    tx1 = -50;
    ty1 = -150;
    tx2 = -50;
    ty2 = height;
}

function draw() {
    background(220, 220, 150);

    //triangle
    fill(100);
    triangle(width/2, height, width/2 + width/4, height/2, width, height);
    fill(255);
    triangle(width/2 + 35, height - 50, width/2 + width/4, height/2, width - 35, height - 50);

    //r curve
    for (var a = 0; a < 1000; a += 10) {
        stroke(50, 50, 255);
        line(rx1, ry1 + a, rx2 + a, ry2);
    }
    //l curve
    for (var a = 0; a < 1000; a += 10) {
        stroke(255);
        line(lx1, ly1 + a, lx2 + a, ly2);

    }
    //b curve
    for (var a = 0; a < 1000; a += 10) {
        stroke(100, 100, 255);
        line(bx1, by1 + a, bx2 + a, by2);
    }
    //t curve
    for (var a = 0; a < 1000; a += 10) {
        stroke(0, 0, 255);
        line(tx1, ty1 + a, tx2 + a, ty2);
    }
}

Drawing of a wave. The white foam and the dark blue are shown using a gradient of 4 ‘curves’.

Image result for tsunami painting
Reference

Hyejo Seo – Project -04: String Art


For this project, I wanted to explore different shapes that could be created by overlapping lines. I thought of playing cards, so I decided to use “Diamond” as my theme. 

sketch

/* 
Hyejo Seo
Section A
hyejos
Project - 04 - String Art
*/

function setup() {
    createCanvas(300,400);
}

function draw() {
    background(47, 47, 47);
    
    for(var q = 0; q < 50; q += 3){
        stroke(106, 127, 219); // blue line 
        line(q - 30, -q, q + 300, height - q + 30);
        stroke(224, 141, 172); // pink line
        line(q - 60, height + q, width + q, q - 60);
    }
    //white lines 
    for(var q = 0; q < 50; q += 5){
        stroke(255); 
        strokeWeight(0.7);
        line(q + 150, height + q, width + q + 160, q);
        line(q - 250, height + q, width + q, q - 260);
    }
    //Joker 
    fill(87, 226, 229);
    noStroke();
    textSize(15);
    textFont('Serif');
    text("J", 283, 315);
    text("O", 280, 335);
    text("K", 280, 355);
    text("E", 280, 375);
    text("R", 280, 395);

    //other letters
    textFont('Serif');
    textSize(25);
    //k + diamond
    text("K", 10, 25);
    quad(19, 35, 30, 50, 19, 65, 8, 50);
    //Q + Diamond 
    text("Q", 10, height - 40);
    quad(19, 369, 30, 384, 19, 399, 8, 384);
    text("J", width - 23, 25);
    quad(width - 19, 35, width - 30, 50, width - 19, 65, width - 8, 50);   
}

Ammar Hassonjee – Project 04 – String Art

Project 04 – String Art

/* Ammar Hassonjee
   Section C
   ahassonj@andrew.cmu.edu
   Project 04 - String Art
   */

function setup() {
  createCanvas(300, 400);
  background(180);
}

function draw() {
    // For loop that allows for reiterations of the line
    // Loop runs 90 times to generate specific shapes
    for (i = 0; i < 90; i++) {
        // Multiple variables declared that are used in line function
        x1 = i * 10;
        y1 = -x1;
        x2 = width / 2 - x1;
        y2 = height / 2 - y1;
        y3 = 0;
        y3 += i * 5;
        y4 = height;
        y4 -= i * 5;

        // Alternating the color of lines to create an intersting composition
        if (i < 50) {
            stroke(0);
        }
        else {
            stroke(255);
        }
        strokeWeight(.5);

        // First pair of top triangles
        line(width / 2, height / 2, x1, y1);
        line(width / 2, height / 2, width - x1, height - y1);

        // Second pair of the side triangles
        line(width / 2, height / 2, width, y4);
        line(width / 2, height / 2, 0, y3);

        // Second series of variables declared to allow for curves to be developed
        stroke(255);
        a1 = width;
        a2 = 0;
        a3 = -100;
        a4 = 0;

        a1 -= i * 4;
        a3 += i * 1.2;
        a4 += i * 5;
        // Top left curve drawn
        line(a1, a2, a3, a4);

        b1 = width;
        b2 = height;
        b3 = width;
        b4 = -5;

        b1 -= i * 4;
        b3 += i * 3;
        b4 += i * 5;
        // Bottom right curve drawn
        line(b1, b2, b3, b4);


    }


}

My inspiration for this project started with testing what combinations of lines resulted from varying the parameters in a for loop. I found interesting patterns where lines clustered together represent shadows, and by alternating colors, I was able to make an interesting composition.

Kimberlyn Cho- Project 04

string

/* Kimberlyn Cho
Section C
ycho2@andrew.cmu.edu
Project 4 */

//all comments in context of left to right

function setup () {
	createCanvas(400, 300);
	background(255);
	strokeWeight(0.03);
}

function draw () {
	for (var i = 0; i < 30; i++) {
		var a = i * 5
		var b = i * 7
		b = constrain(b, 0, width / 2);

		//bottomleft fold
		stroke(0);
		line(0, b + height / 2, b, height);

		//middle gray fold 
		stroke(105);
		line(0, a, b, height / 2);
		stroke(0);
		line(b, height / 2, width / 2, height / 2 + b);
		stroke(105);
		line(width / 2, height / 2 + a, b + width / 2, height);

		//middle red fold
		stroke(160,0,0);
		line(0, a / 2, b / 2, height / 4);
		stroke(72,0,0);
		line(a - width / 9, height / 4, width / 4, a + height / 4);
		stroke(160,0,0);
		line(width / 4, a + height * 0.26, b + width / 4, height * 0.75);
		stroke(72,0,0);
		line(b + width / 4, height * 0.75, width * 0.75, height * 0.75 + b);
		stroke(160,0,0);
		line(width * 0.75, height * 0.75 + b, width * 0.75 + b, height);

		//outer right
		stroke(0);
		line(width, b * 1.5, b * 2, 0);

		//middletop
		stroke(0, 0, 204);
		line(b, 0, width / 2, b);
		line(b + width / 2, 0, width / 2, height / 2 - b);
		
		//pins
		fill(0);
		ellipse(0, 0, 20, 20)
		ellipse(0, height / 4, 10, 10)
		ellipse(width / 4, height / 4, 10, 10)
		ellipse(width / 4, height * 0.75, 10, 10)
		ellipse(width * 0.75, height * 0.75, 10, 10)
		ellipse(width * 0.75, height, 10, 10)
		ellipse(width, height, 20, 20)
		ellipse(0, height / 2, 10, 10)
		ellipse(width / 2, height / 2, 10, 10)
		ellipse(width / 2, height, 10, 10)
		ellipse(width, 0, 20, 20)
		ellipse(0, height, 20, 20)

	};
}

I was inspired by tensile systems such as pinning down flexible materials such as nylon. I used different shades to emphasize the folding pattern of the middles pieces.

Gretchen Kupferschmid-String Art-Project 04


with this project, I wanted to play around with color and the way layering string art and color can create an abstract piece of art.

sketch


function setup() {
    createCanvas(400,300);
    
}
 function draw (){
    background(235, 192, 52);
    for (i= 0; i<200; i+=5){
    stroke(244, 192, 252);
    line(i-100, 0, 400, i)
        
    stroke(244, 192, 252);
    line(0, i, i, 200)
    
    stroke(244, 192, 252);
    line(i, 200, 0, 600-i)
    line(i, 250, 0, 300-i)
    
    }
    for(i=0; i<400; i+=10){
    stroke(255);
    line(400, 300-i , i, 300);
    line(400, 200-i , i, 300);
    line(400, 100-i , i, 300);
    line(400, 50-i , i, 300);
    stroke(209, 61, 90);
    line(100-i, 150, mouseX, mouseX);
    line(300-i,0, i-290, 150);
    
    
    }
 }