Monday, November 30, 2020

Don't Get Hypnotized by My Bouncing Balls



DoodleChaos programmed three falling balls to play Bach's Prelude in C Major as they bounce down an incline. You will be hypnotized. 

I coded a simulation in Unity which generates bouncy blocks to represent piano notes at the correct position so the physics can make music. It was a fun project to make sure that all the constraints I wanted were met. There is a lot of room to improve it, my approach ended up being a pretty brute force search for the best bounce trajectory based on the future camera position. I also included penalties for crossing the path of another ball because they could get bunched up and not find any valid moves.
Yeah, yeah, that's all very interesting; just watch the result.



No comments: