Recitation4
This time my work was totally a surprise when I was doing exploratory coding.
Basically I wanted to use for loop to draw a pattern with sine function and I got this
then I changed some variables and create to more patterns.
Then I tried to make something new by rotating the blue pattern, that’s when some unexpected changes happen. I added the code translate(300,300); rotate(90); and the result is a total surprise.
I found it really interesting and beautiful, s0 I changed the variables of size, color and intervals, or even combine two patterns together,which helped me get several more patterns
What is really a pity is that I couldn’t understand how exactly the pattern is generating, I tried to modify the code, but never succeeded in moving the pattern to the middle of the canvas.
the following is the code of my favorite pattern, the left one in the second row.
function setup() { createCanvas(600, 600); background(220) // YOUR CODE HERE // .. variables that accumulate values // .. loops // .. transformations // .. conditionals // .. randomness for (let x=0; x<width; x+=0.5){ noStroke(); fill(25,x,x*sin(x)) circle(x,50*sin(x)+100,10); translate(300,300); rotate(90) fill(160,x*0.37,x*0.4); circle(x,25*sin(x)+100,10); //fill(242,146,27); //circle(2*x,50*sin(x)+100,10); } // AFTER YOUR CODE HAS RUN: saveCanvas('yourname', 'png'); // saves the canvas as a png image }
here’s the link to p5 https://editor.p5js.org/zzrrqqq/sketches/p69E1m8Cm
Reflection:
1.This time the largest difference is that when drawing by computer, one may get something totally different from what they expect, and that can be a surprise, but when drawing by hand, most of the times the result is fixed, even if there is a surprise, it could only be a small one. And for commonalities, I think both ways of drawing needs designing and choosing of color.
2.I used the for loop function and rotate function, the formal one is really convenient to use and change, which means I can generate different images with the same logic with some slight changes. The latter one is quite interesting as it may create something really surprising while beautiful.
3. I think the most important factor is whether the pattern is logical. For example, if you have some dots or lines, they should either obey a certain rule or logic or represents some concrete things. If they are just randomly generated lines, even though they might be beautiful, that’s not a good generative drawing. The second factor is the choose of color, they should be in a harmony, there should be some functions instead of random generated color.
Leave a Reply