This week is about generative motion. We used a lot of tools that can generate random motions.
- One important thing I learned this week in general is that when coding, we can start with definite numbers to generate the shapes, and if the codes work well, we can change certain parts of them so that variables can be added in. Here’s how I applied it in the exploration stage:
- I was (and still am) very obsessed with cleaning up my codes and cutting the variables I used, but things didn’t work out as I expected:
- Previously it was: xPosition; yPosition; xPosition1; xPosition2; y Position2; but I forgot what xPosition1 is for so I deleted it, and put xPosition/ yPosition in both of the circles
- It generated an overlap between the loop and the moon-shaped thing first, and later was the moon-shaped thing inside the loop
- Previously it was: xPosition; yPosition; xPosition1; xPosition2; y Position2; but I forgot what xPosition1 is for so I deleted it, and put xPosition/ yPosition in both of the circles
- It’s important to differentiate sin & cos as well, if in all of the yPosition I still put sinValue, I can only generate linear motions
- For the entire project, one thing I regret is that I don’t think I fully understand the function of sin/ cos and those angles. I will try to employ them in later projects more. But I did learn how to use the ‘map’ function 🙂
Answers to the prompt
Prompt 1: math functions
-
- random():
- to generate random degrees
- This is def one of my favorite functions, because it can generate something unexpected and make the whole piece more random
- radians():
- to turn the angles in degree into angles in radians so that I can put them in the trig functions
- sin() / cos():
- to get numbers within the range of (-1,1)
- challenging because I might forget turning the degrees into radians
- random():
Prompt 2: motion
-
- I explored: linear motion; circular motion and oscillatory motion
- If I combined two motion or more in one shape, the whole piece will look like a total mess, so distributing them onto different shapes would be better xp
- I wanted to explore the oscillatory motion, so I gave the horizontal frames a oscillatory motion
Prompt 3: sin(); cos() & map() function
-
- I set the sin/ cos value as inputs so that I can generate shapes in different positions
- Map function is really effective because I don’t have to use “ [variable] = 300 + (sin()* 300)”
- One interesting thing is that:
-
- “ let xPosition=map(sinValue1,-1,1,100,400); ”
- “ let yPosition=map(cosValue1,-1,1,100,400); ”
- if i change cosValue1into sinValue1, the xPosition and the yPosition will be the same and the shape will move in a linear motion
- if i change the lower/ upper bound of the value’s current range:
-
Prompt 4: generating circular/ angular movement by sine and cosine
-
- using map function
- eg: y= map(sin(xRadians),-1,1,100,300)
- using map function
Leave a Reply