鱼在画中游,改编自——
舟行碧波上,人在画中游——《桂林山水》,陈淼
Fish swimming in the painting, adapted from:
Boat sailing on the blue waves, and people wandering in the painting— “Guilin Landscape”, by Miao Chen.
You can tell my mental state from my BGM: 荷塘月色(Moonlight in Lotus Pool),by凤凰传奇
which was popular about 17 years ago and loved by many elderly and is my childhood memory.
- Working Process
- Inspiration
You might find this similar to my weekly assignment 2, “Lotus in the Rain,” because the lotus flower motif comes from there. They share many common elements: fish and lotus leaves, among others (although their shapes are different from those in assignment 2). However, their underlying principles of motion are completely different. In this assignment, lacking better inspiration, I wanted to revamp and combine some elements from previous assignments to create something with a different style. Also, because of an art lecture I attended last Wednesday mentioning how ancient Chinese women often enjoyed painting on fans, I wanted to incorporate this element as well, creating a canvas that seems ethereal, with the objects in the painting partially contained within but sometimes breaking out of the canvas, giving it a dynamic feeling. (Actually, all these inspirations came up one by one in my process of coding).
- Code Building & Logic Behind
Avoiding Function:
Fishes avoid each other; Fishes avoid the moving lotus leaves;
I made modifications to the “Avoiding each other” code. Initially, I changed all instances of “vehicles” to “fishes” and drew the shapes of fish. Then I adapted the “avoid obstacles” code to make fishes avoid obstacles upon collision. However, it seemed a bit boring, so I thought making the obstacles move would be more interesting. That’s when I remembered class 4 in my weekly assignment “Gravity in My Mind,” so I turned the obstacles into them. Now, it’s a bunch of fishes and circles moving around, and those circles looked a lot like lotus leaves to me. I changed their colors and shapes to ovals, giving a feeling of a lotus pond.
Seeking Function:
Fishes seeking flowers.
However, fishes need something to chase; otherwise, why would they follow the mouse? That’s when I thought of lotus flowers; fishes would seek them out when they smell the fragrance. So, I added the shape of lotus flowers and hid the mouse cursor. I achieved the main function I wanted, but since I got an extension and didn’t want it to be too rushed (I’m so honest!), I decided to make some further adjustments.
Avoiding Function new Ver + Area:
Firstly, I added some stones as static obstacles for fishes to avoid. Then, I recalled the lecture I attended on Wednesday about ancient Chinese women liking to paint on fans. So, I decided to adjust the example code related to the Area, ensuring that fishes and lotus leaves are confined within a certain area (able to move outside the fan canvas yet feeling constrained inside it).
GUI & Text:
Finally, I added a GUI for the number of fishes and C_GRAVITY, allowing fishes to increase or decrease and preventing lotus leaves from suddenly sticking together. Lastly, I used the “Long Cang” font from Google Fonts to add the phrase “Fish Swimming in the Painting,” giving it more of a Chinese painting vibe.
Waves:
In addition to the parts above I also added a modified version of the sin wave from the “The Ballet” assignment to create a cloud-like and ethereal effect.
Finished Work:
With BGM
Explanation Ver (GUI shown)
- Reflections & Things Learned:
I spent some time figuring out how to write the “avoid” function properly, understanding when to use “return” and when to use “continue,” and I asked ChatGPT about this. I’m also happy that my obstacles can move. However, I find it a bit annoying that the fish sometimes keep spinning around, and sometimes the screen gets a bit messy. If I need to further develop the artwork, I might need to address this issue and aim for a more aesthetic effect.
Regarding what I learned:
- How to utilize seeking, arriving, steering, and avoiding functions.
- How to reuse combinations to present different effects with similar elements.
Leave a Reply