NOC W4 - Fish&SeaWeeds

Final Version: https://editor.p5js.org/WangZhewei1027/sketches/xBHhopTw2

This program simulates the visual effects when fishes swimming between seaweeds.

Inspiration: Fish swimming between seaweeds

Version 1: https://editor.p5js.org/WangZhewei1027/sketches/r2mMf0XXK

In the process of refining the parameters, the effects didn’t go as expected. But it generated some interesting effects as below.

https://drive.google.com/file/d/1IA6iLvTgurz7-utqktYaKifP9ONgKroK/view?usp=drive_link

https://drive.google.com/file/d/1dA7oG5h7Sez24a7Ej2kLpILw7DeRTKOV/view?usp=drive_link

Version 2: https://editor.p5js.org/WangZhewei1027/sketches/DF9YOLrBs

https://drive.google.com/file/d/12lytjp8-n8etfZRUN5aZ8eJc_N_LNBgq/view?usp=sharing

https://drive.google.com/file/d/1YK1eE39iNr-MQPKPPUGeuL1RLANhM8nM/view?usp=drive_link

https://drive.google.com/file/d/1Sk0u_xStp-7SWiZ4uHb5YvxASP0nHABB/view?usp=drive_link

https://drive.google.com/file/d/19LELjqSEtpiqCmDYA2HdfpZnFa-h1oOU/view?usp=drive_link

https://drive.google.com/file/d/1qwH836oPmoeqs53jRK-CXO6RXZohXXWR/view?usp=drive_link

Final Version: https://editor.p5js.org/WangZhewei1027/sketches/xBHhopTw2

The most challenging part is letting the fish head in the direction of velocity. After using the atan() function and some math calculations, it finally works.

https://drive.google.com/file/d/144w9JYl6yfv7_HhtyrD2RjCOQKEBtac3/view?usp=drive_link

Reflection: There are still some bugs that can be improved. If there are more than one fish, the effect is not completely correct;

I feel the process of refining parameters needs to be based on full understanding of the functions.