Title: nine patterns
Link: https://editor.p5js.org/LafouCC/sketches/2DkSpH9v4
Description: In this project, I mainly utilized three methods:
The first is to make use of the circular pattern of circle(sin(a), cos(a),dia).
The second is to make use of rotate(angle) and create a complex shape using simple elements.
The third is the recursive function, I want to use this chance to be more familiar with recursive functions.
Picture:
Code Snippets:
I think the code for the red flower is relatively complicated.
I used nested loops three times: the outside loop to change the color from the darker inside to the lighter outside; the middle loop to rotate the petals; the inner loop to use vertex() to create the element petal.
for (let d = 0; d < 50; d++) { for (let i = 0; i < 8; i++) { rotate(i * 45.02); beginShape(); for (let angle = 0; angle < 360; angle++) { ... vertex(sinValue, cosValue); } endShape(); } }
Reflections:
- How is drawing by hand from observation different from programming the computer to draw for you? Can you think of some commonalities as well?
Drawing by hand compare to programming is more intuitionistic while programming is more convenient to do repetitions. Sometimes, using different math functions and rotations can achieve very surprising and unexpected effects.
- What properties have you manipulated in the repetition? Describe your observations and visual outcomes during the process.
I manipulated the rotate angle, the distance from the original point to the graphs, and the gradient of colors. And I also change the radDist in the first pattern to make the sea snail have more layers.
- What makes a good generative pattern?
I think a lot of things can contribute to a good pattern. For example, symmetry can make a graph very good-looking. And the utilization of gradient colors and the gradual change of size can also be keys to achieving good results. Also, sometimes a little randomness can be nice and fun.