Vectors and Forces

This is a later example (and the code editor), adding mouse interaction to act as a force on the bubbles. Notice that they only bounce off the walls when the mouse is pressed down, and then released otherwise (big thanks to Dan Shiffman for helping me implement this behavior).

Here is the first example using vectors and bubble objects in fullscreen and the code editor. I started by copying Dan’s NOC Bouncing Ball Vector Objects example and then making an array, pushing out a new bubble each time through draw and popping a bubble when they reach a count of 600 (I got a reminder about splicing and pushing with arrays here).

I also referenced Gene Kogan’s perlin noise code again for the oscillations in the purple color. And I referenced a technique I had used in a previous project (The Donut) to make the eye oscillate. I also used the processing / p5.js github wiki to center my canvas when going fullscreen. Very helpful in displaying work, but I would like to know more about embedding directly onto a web page and running the javascript only when the sketch is being displayed. This way there are no external links or resolution lost when exporting a sketch to a pic, video or gif.

Perlin Noise

I took some ideas from Gene Kogan’s Perlin Noise examples. I love the way this line moves and tumbles back over itself. One key element and favorite trick was to decrease the background opacity. I still don’t fully grasp what is happening with Perlin versus random in that random will continuously give random numbers in draw() but Perlin noise only outputs one value and how that is overcome, even in my own example.