Final Code with mouse interaction: p5.js Web Editor | NOC_final_mouseInteraction (p5js.org)
Final Code with motion detection: p5.js Web Editor | NOC_Exhibit (p5js.org)
Project Description
In the era fluctuating with information, we constantly feel overwhelmed by all the over-exaggerated, eye-catching, but maybe toxic taglines all over the internet. #DROWN intends to visualize this feeling of being suffocated and drowned by all the text on the internet, particularly on social media.
The project #DROWN uses hashtags on the trending chart of major social media platforms (Weibo and Twitter) as the major element, representing overwhelming information online; when users interact with the project in a certain way (motion/mouse interaction), the texts would change their usual stage where they flow around, and gather around the users’ position and fluctuated, creating the feeling of over-flooding the users.
Process
#stage 1: break down texts
p5.js Web Editor | NOC_final prototype 2_words separate_OOP (p5js.org)
Since each line of text is expected to fluctuate and move so they don’t seem so idle, I first wrote an object that takes an input text and then used for loop to break down each character of that text as an element inside an array. Then, I used sine( ) to reposition each of the characters along a sine wave and rotate each of the characters. Lastly, I added a little noise value to the height and rotation angle so they are not so regularly positioned along the sine wave.

#stage 2: flow field + mouse attraction + gui
p5.js Web Editor | NOC_final prototype 4_gui_attractToMouse (p5js.org)
Then, I created a flow field for the texts to flow in the canvas organically, and added mouse attraction for the texts to follow the mouse position. After transforming what we learned in class and achieving what I wanted, I noticed that the texts sometimes get too close to each other and can’t be identified. Thus, I added some repulsion to the words, which looks great.


I also added GUI to control the angle of the words floating, the fluctuation for each line of text, and the repulsion of all the text for some user interaction and customization.
#stage 3: change 2 states + text input
p5.js Web Editor | NOC_final_mouseInteraction (p5js.org)
Then it’s the last part of the code before the in-class presentation where I designed 2 stages for the how experience and added a user text input for the users to add text into the canvas.
For the 2 states, the first one, which is the “default” state, the texts all flow in one direction, which could be changed by GUI; the second one, is when the user clicks the mouse, and then all the texts will flow to the direction of the mouse and gather around the mouse for 15 seconds in default (also customizable by using GUI). The 2 states are easily distinguishable by simply changing the angle of the flow field.

What troubles me most was to time in the second state for all the texts to fly towards the mouse for a certain duration of time when the mouse is clicked. Thus, I searched online and find a way to make that happen, which is to use “millis( )” to get the current time and in the “mousePressed( )” function get the start time when the mouse is clicked.

Adding the part for users to input text is easy to just have another text pushed into the whole array of words with the help of dat.GUI.
However, what bothered me most is to have the input text displayed in another color, and then change to white like the others after some time. I tested multiple times and ended up adding a timer using “setTimeout( )” and “clearTimeout( )”, and having the color of text as a variable inside the constructor to be reached outside of the object and ultimately achieved the desired outcome.

#stage 4: motion capture
p5.js Web Editor | NOC_Exhibit (p5js.org)
This part is mostly done with the help of Professor Moon (thank you so much!!!). We used MoveNet to get the position of the nose of the user and replace the mouse position with the nose position. In this way, the texts will gather around the user as desired
Reflection
What I learned most from this project is to time certain actions in js. For example, how to time the change of newly input text colors using “setTimeout( )” and “clearTimeout( )”, and how to time the 2 states using “setInterval( )”. This function is really helpful when certain movements are expected to change or triggered in a set timing.
Simultaneously, I also got to explore how to play with texts, especially how to break down a set of texts into small segments to change the overall look of the texts.
Meanwhile, I also got to familiarize myself with things learned throughout the semester, including flow field, repulsion, dat.GUI, and oscillation.
Motion capture is also something I got to know the first time and could explore in the future.
Further Development
For further development, the first thing is about the sound. What I think works best is some voiceovers of the texts on the screen repeating again and again, to amplify the overwhelming feeling. And when the texts get closer to the user, the sound will echo more and become louder.
Also, I think it would be a good idea to actually have the texts grabbed from the trending chart of Twitter synchronously so that conceptually it makes more sense. Professor Leon advised me about API, which I could explore later to make the project better.
Last but not least, I think the switching between the 2 states could use a little bit more thought into it. To be more specific, I think not the states switch every 20 seconds. However, conceptually I don’t think this setting works. I think maybe the state of being attracted to the user could be triggered when the user stays in front of the screen for a certain time, and then switch to the default state (just a random thought now, it might not work perfectly).





















