Project Title: A Story
Link:https://editor.p5js.org/Lisa-HuangZijin/sketches/SV6tP4p3K
Brief: This animation shows us the life of lambs in the grassland. In this short animation, I want it to be a loop which seems never have an end. So you can see there is alternating day and night. My concept is very brief. I want to create a place of utopia where lamps have no worries about life. Of course it will not come true in our normal life, but in the digital life, this place carries my yearning for a happy life.
Coding: First of all, I’ve tried having no background so that the alternation of day and night colors will become more natural. But I failed because the cloud I create will also leave tracks which is not satisfying. The second interesting part lies behind the cooperation between sun and the sky’s color. I carefully match the sun’s color with the sky using the frequency. As you can see in the following:
I think I have question about how to make different patterns a group to create more complex patterns and let them move according to what I want. And, I still think the part I create stars can be brief since we’ve done the reading about Repeat. I hope I can beautify my code later.
- List math functions that you utilized in your animation. Please share your experience while using them. What functions did you find useful? What made you confused and struggle?
I’ve used sin and cos to create the lamps’ moving tracks. And x=x+1 to create clouds’ moving. Mixing sin and map together, I become able to create color variations.
I found cos most useful because it give me the sense of loop and can be applied to color, position and size. I once tried to use rotate to one specific pattern, but I eventually find that all the subjects on my canvas begin rolling together. I think it may because of loop, but if I state “noloop”, then I can not let other patterns move. That’s the biggest problem I’ve met with this project.
- What kind of motion have you explored? What was the process like while combining them?
I just explored how to change the color of the sky and make sun and moon change according to it. The key is to manage their periodicity.
- How did you adjust sin() values using map() function? Describe the effectiveness.
For example, map(sin(a), A, B, C, D) I think the most important thing is to understand that the distance from A to B can be projected as the distance from C to D. So it is kind of like I assign the value of A to C and the value of B to D. To make the order of variation correct, sometimes it is important to change the position of C and D.
- How can circular (angular) movement be generated using sine and cosine?
Let x follow the track of sine and let y follow the track of cosine. It is also OK to team up x and cosine, y and sine.