Mini Project 4: Patterns – by Bonnie

Mini Project 4: Patterns

Link:

https://editor.p5js.org/Hanjing2002/sketches/O4v9dYiDR

Brief Description

I created 9 graphs in setup() function in p5.js.  For the first 8 patterns, I used  rotate() function to mutated the original shape. As for last one, I assigned it random y value while x stayed the same.

Visual Demonstration 

 

Coding

#image 4

In this image I tried to experiment the asymmetry and irregular shapes. However, I find there are 3 versions of it when I run many times but I’m not quite sure what is the reason. Below is the code of image 4.

//image 4
push()
translate(100, 300);

stroke(5)

for (let angle = 0; angle <= 360 * 3; angle +=15){

//x = map(sin(angle), 0, 0.8, 0, 40);

rotate(angle);
beginShape();
curveVertex(x,y);
curveVertex(x+55, y-3);
curveVertex(x+8, y+2);
curveVertex(x-3, y+9);
curveVertex(x-20, y-10)
curveVertex(x,y);
endShape()

fill(40,150,180)

}
pop()

 

#image 7

 

Image 7 is the one I like the most among the 9. I experiment map()function to the coordinates of the ellipse. It was not a pleasant helix before but after I changed the radDist and start and stop number of the map() function, it became more satisfying. I hope to figure out what exactly controlled it and apply it to my project A. Below is the code of image 7.

 

//image 7

push()
translate(100, 500)

for (let angle=0; angle<= 360*4; angle+=15 ){
let radDist = angle*0.04;
let r = map(cos(angle), 0, 1, 180, 255);
let x = map(sin(frameCount) * radDist, 0, 100, 0, 150);
let y = map(cos(frameCount) * radDist, 0, 100, 0, 100)
rotate(angle*0.00014);
ellipse(x, y, 10, 20)
fill(r, r-100, 0)

noStroke()

}
pop()

 

Reflection

– Differences and similarities of drawing by hand and programming with computer

When drawing by hand, I just need to locate the pen on the paper that I would like to draw; but when programming, there are times to use some calculations and coordinates. But it is much easier to program when I need repetitive patterns (with some variations). And it is always easier to program to make adjustments. Picking colors process is similar, as for me. When drawing by hand,  we need color palette to pick our desired color; when doing programming, I sometimes use color picker to find the right color.

– Repetition

Rotation and randomness are very useful when making repetitions. However, I find rotation is more controllable when creating patterns(image 1-8). When apply randomness to the coordinates/shapes, they often create orderless image. I had to manually keep one value the same and manipulate the other (image 9) so it is not too bored to look at.

– What makes a good generative pattern?

From my experience, there are multiple factors that makes a generative pattern interesting. The unpredictability could make the pattern surprise the viewer all the time. This often needs the help of random() function. The generation pattern better have a focus which drags viewers’ attention. The colors in the patterns could be of same hue, saturation, or just adjacent color to creat harmony. If there are opposite color, there might also have some transition colors presence. Generally speaking, I would say the best generative pattern perform order in orderlessness.

 

 

 

 

Drawing with Code – Bag Beside the Table

Drawing with Code – Bag Beside the table

Link:

https://editor.p5js.org/Hanjing2002/sketches/WFo9JU6y9

Description and Concept:

This drawing is originated from a picture I took of my bag placing against the table. I chose this picture because I notice there are different geometry shapes involved and I thought it would be interesting to draw them. The drawing basically apply similar colors of the original picture.

Pictures:

Coding:

the irregular close-to-white area:

beginShape();
curveVertex(0, 300);
curveVertex(40, 270);
curveVertex(90, 280);
curveVertex(110, 310);
curveVertex(105, 380);
curveVertex(80, 315);
curveVertex(10, 375);
curveVertex(8, 325);
curveVertex(0, 320);
endShape(CLOSE);

Process:

At first I draw it with part of a rotated ellipse. It was faster when I coded it than the code I did now. But then I realized that the shapes I drew after that code (those black shapes in front of it) could not been show properly and I need them to be on top of the ellipse. Then I make an inquiry about this problem to Professor Moon. He told me that rotate is complicated for me now since it might  change the whole canvas. He suggested me that I could use curveVertex instead. It is better that simply draw a curve because I can filled the area with color. So I tried this method. It worked out fine but I change the Vertex so many times to make the curve look smoother.

Reflection:

I prefer to use reference first and try exploratory programming with unsolved problems. Because I find  it easier to use the references, they saves a lot of time.   The limitation is they might not be able to draw everything I want so I will experiment with exploratory programming and it can give me some surprising results(irregular black shape at bottom left corner).

I find it is easy to draw on the paper for the location of each shape. I don’t need the coordinates of each vertex. On the other hand, coding performs better on filling colors and drawing regular shapes.