Recently I had the pleasure to work on one of the funnest projects ever: The Bubble Figure.
The Bubble Figure was created by a team of volunteers at Wunderdog for Grand One 2023, annual design awards that take place in Helsinki. Our designers created the visuals for the event and wanted to do something extra.
After exploring various ideas, tech, and taking the time and resource constraints into mind, we decided to go for The Bubble Figure.
The Bubble Figure is an interactive experience that runs in the browser. When a person is recognized via the webcam it makes them appear as a colorful bubble figure. They can then interact with various shapes that fall from above, for example, by hitting them. Simple and fun, and all in the visual language of Grand One 2023.
The figure is randomized every time a new person is detected. The shapes falling from above are also randomized, while using certain geometries and textures.
To simulate physics, cannon-es is used, a maintained fork of cannon.js (we found out the hard way cannon.js wasn't maintained anymore). Shape coordinates are mapped from the physical world to the Three.js scene, while the figure is mapped from the scene to the physical world.
Funnily, none of us had any experience with these libraries. We learned everything the best way: on the job, with lots of trial and error.
ChatGPT was very useful to understand some concepts from the tech stack and generate basic code. But of course, this required some fixing and modifying to get it to work.
We did quite a lot of tinkering from the design perspective, to make sure The Bubble Figure looks alright. This required adjusting the number of bubbles, their sizes, offsetting their positions, and adding randomness to create various interesting results.
Absolutely! You can check out the latest demo on GitHub pages.
Please use Google Chrome, other browsers are not supported. Allow the browser to use the camera. Then take a few steps back to make sure that your pose is detected, and knock some shapes around.
You can also hit Command + K on Mac or Ctrl + K on Windows to adjust various parameters. Clicking Apply will save the parameters in the browser's local storage.
Of course, it wouldn't be a software project without limitations.
For instance, cylinders and cones don't always collide with the figure in a smooth manner. We improved it a bit by randomizing the figure's bubble z coordinates. Still, some weird collisions may happen. Isn't it part of the fun though?
We also found it rather difficult to render the bubble figure always in the same size, regardless of the person's distance from the camera. Maybe given more time we would have succeeded, but we had to release the project.
The frame rate also changes once the pose is detected. Nothing really bad, even though ideally it should be consistent.
The Bubble Figure has been released as open source in the Wunderdog GitHub account.
Since we were short on time, we did rapid prototyping and the code got very messy. So, following the event, we spent about a week cleaning it up and also adding TypeScript.
One thing I might have done differently, is to create a the figure with a skeleton. Then it should be easier to move the skeleton's joints and possibly to keep the figure the same size regardless of camera distance. Oh well, next time.
I hope that you like this little project. May you find it useful if you would also like to create an interactive browser experience with pose detection, 3D graphics, and physics.