//Jonathan Perez
//Section B
//jdperez@andrew.cmu.edu
//Project-4
function setup() {
createCanvas(400, 300);
background(0);
pixelDensity(5.0);
noStroke();
colorMode(HSB, 360, 100, 100);
}
function draw() {
background(0);
noStroke();
var x1;
var x2;
var y1;
var y2;
var r = 90; //radius of iris
var eyeBright; //variable used to fade iris background to black
for (var i = 0; i < 100; i++) { //iris faded background
eyeBright = i;
fill(213, 20, eyeBright);
ellipse(width/2, height/2, 2.5*r - i*2.5*r/100, 2.5*r - i*2.5*r/100);
}
//blue iris coloring
translate(width/2, height/2);
for (var i = 0; i < 4; i++) { //for loop to create four foci by which to fill in the iris
push();
angleMode(RADIANS);
rotate(i*PI/2); //rotates 90 degrees between foci
for (var j = -14; j < 15; j++) { //21 strings from each foci are used to fill in circle
if(j == -1 || j == -2 || j == 1 || j ==2 || j == -14 || j == -13 || j == 13 || j == 14) {
continue; //skip center lines for both star visual effect, and to
//concentrate blue color to the outside of the iris
}
angleMode(DEGREES);
x1 = -r;
y1 = sqrt(sq(r)-sq(x1)); //uses equation for a circle to calculate y coordinate
x2 = r*cos(12*j); //makes and end point every 12 degrees
y2 = r*sin(12*j);
stroke(199, 46, 80); //blue
strokeWeight(1);
line(x1, y1, x2, y2);
}
pop();
}
//green center iris
var r2 = 5*r/12;
for (var i = 0; i < 4; i++) { //for loop to create for foci by which to fill in the circle
push();
angleMode(RADIANS);
rotate(i*PI/2); //rotates 90 degrees between foci
for (var j = -12; j < 13; j++) { //21 strings from each foci are used to fill in circle
if(j == -1 || j == -2 || j == 1 || j ==2) {
continue;
}
x1 = -r/2;
y1 = sqrt(sq(r/2)-sq(x1)); //uses r/2 to create a star shape
angleMode(DEGREES);
x2 = r2*cos(15*j); //makes and end point every 15 degrees
y2 = r2*sin(15*j);
stroke(77, 93, 48);//pale yellow/green
strokeWeight(.5);
line(x1, y1, x2, y2);
}
pop();
}
fill(0);
ellipse(0, 0, r/2, r/2); //pupil
fill(100);
ellipse(r/7, -r/8, r/9, r/9); //pupil light reflection
//outside iris
for (var i = 0; i < 30; i++) { //upper right accent
x1 = i*(r+r/4)/29
y1 = -r - r/4
x2 = r+ r/4
y2 = -r - r/4 + i*(r)/29
stroke(80);
line(x1, y1, x2, y2);
}
for (var i = 0; i < 30; i++) { // lower left accent
x1 = -i*(r+r/4)/29
y1 = r + r/4
x2 = -r - r/4
y2 = r + r/4 - i*(r)/29
stroke(80);
line(x1, y1, x2, y2);
}
//eyelid
translate(-width/2, -height/2)
for (var j = 0; j < 45; j++) { //fills in quarter circle with 45 lines
x1 = 0
y1 = height - j*height/45
x2 = j * width/45
y2 = 0
stroke(100 + j*4, 60, 77); //slowly changes color from green to purple from left to right
line(x1, y1, x2, y2);
}
for (var j = 0; j < 45; j++) { //fills in quarter circle with 45 lines
x1 = width
y1 = height - j*height/45
x2 = j * width/45
y2 = height
stroke(100 + j*4, 60, 77); //slowly changes color from green to purple from left to right
line(x1,y1,x2,y2);
}
}
This project was pretty difficult for me to wrap my head around at first… I had never done any sort of string art before, nor could I quite get the feel for it. So, the way I started this project was pretty much playing around with the string art form: trying to make different shapes, and seeing what different loops I could use to accomplish drawing efficiently.
Somewhere along the lines, I ended up deciding on an eye as the theme for my drawing. Once I got going, I discovered some of the advantages of using string art, mainly, its ability to create compositional lines. After deciding on the shapes and composition, the next thing was the color and negative space. Negative space was definitely something that I realized later on was a very important part of the string drawing. Originally, all of the space was filled with strings, and the drawing became quickly cluttered. I had to decide on what to remove, and where perhaps I should use less strings to render the shapes.
As for the finished product, I enjoy how the strings led to a reptilian aesthetic. The spaces between the lines give the image texture and curvature that would be hard to do otherwise. The iris of the lizard’s eye plays off the geometric qualities of drawing with string art, creating different polygons with the lines and shapes where lines are removed.