Documentation:
For this assignment, I used sin, cos, radians, map and for loop functions to make up waves to simulate texture of clothes. I referred to this website for the basics of waves.
The most challenging part is to imagine what the outcome would be like when entering parameters for the map function, so I kept trying different values to achieve what I expect. I actually didn’t have a blueprint in my mind at first, instead, I was inspired as I adjusted the parameters. As I changed the rate of “frameCount” and the index “I”, the small rectangles started to gradually make up specific patterns.
The up-left corner of my work came out unexpectedly, but it caught my eyes for its regularity. At the beginning, it looks like this:
It moves like it’s knitting and sewing, so I thought that I can try to make patterns of textures. The first problem I encountered is that as the white rectangles move, they started to pile up, and eventually covered the entire screen, so it became all white after some time. To solve this, I introduced waves into color setting, where I wrote this line of code:
float color1 = map(cos(radians(frameCount)*5), -1, 1, 0, 255);
This line basically changes the color every time the draw function runs, so that they will never be able to fill the entire screen, but gradually changes.
But one pattern still seems too simple, so I decided to add more with different styles. I set the size to be (500, 500) to hold four patterns regularly.
The up-right corner is almost the same pattern with the left one in a different color, but I found it interesting that the waves of lines are harmonically connected. For the two textures below, I combined different parameters and they are knitting and moving in different ways. The left bottom one is like it is printed out, and the right bottom is made up of numerous dots. It takes some time for these two to form the final patterns.
Finally, I set them all to share the similar speed so that they can synchronize with each other as the pattern changes.
For my simple work of art, I chose to display textures of clothes in a dynamic way. For me, usually I pay more attention to the patterns and designs of clothes, not the textures, but texture is actually the most basic and significant element of clothes.
void setup() { size(500, 500); background(0); } void draw() { noStroke(); for (int i=0; i<80; i++) { float wave1 = map(sin(radians(frameCount * 0.8 + i)), -1, 1, -100, 500); float wave2 = map(cos(radians(frameCount + 10*i)), -1, 1, -100, 500); float color1 = map(cos(radians(frameCount)*5), -1, 1, 0, 255); fill(color1); if (wave1 > 0 && wave1 < 250 && wave2 > 0 && wave2 < 250) { rect(wave1, wave2, 6, 8); } float wave11 = map(sin(radians(frameCount * 0.8 + i)), -1, 1, -100, 500); float wave22 = map(cos(radians(frameCount)+i), -1, 1, -100, 500); float color2 = map(cos(radians(frameCount)*2), -1, 1, 0, 100); fill(color2); if (wave11 > 250 && wave11 < 500 && wave22 > 0 && wave22 < 250) { rect(wave11, wave22, 5, 5); } float my_color1 = map(cos(frameCount * 2), -1, 1, 0, 255); float x = map(sin(frameCount * 0.8 + i), -1, 1, -100, 500); float y = map(cos(frameCount - 10 * i), -1, 1, -100, 500); fill(my_color1); if (y > 250 && y < 500 && x > 250 && x < 500) { rect(x, y, 2, 2); } float my_color2 = map(sin(frameCount * 10), -1, 1, 0, 255); float x1 = map(sin(radians(frameCount * 0.9)), -1, 1, -100, 500); float y1 = map(cos(radians(frameCount * i)), -1, 1, -100, 500); fill(my_color2); if (y1 > 250 && y1 < 500 && x1 > 0 && x1 < 250) { rect(x1, y1, 3, 3); } } }