Bouncing Balls in 2D and 3D

I just uploaded Bouncer3D to the pattern library. and to my pattern repository.

It bounces from 1 to 20 colored balls around a 2D or 3D volumetric display at a reasonably high frame rate. You can control the number, size and speed of the balls with sliders.

This started life as part vector library proof-of-concept, and part “hmmm… how would I do this?” experiment based on a discussion of optimizing 3D spheres in another thread. It turned out fun to watch, and I hadn’t seen any similar patterns, so I posted it!

The optimizations give it interesting properties. As you’d expect, performance decreases with increasing number of objects. However, increasing the size of the objects decreases the number of unoccupied pixels you have to examine, so performance goes back up as you make the spheres bigger. You can actually bounce 10 or 12 balls around a volumetric cube at a decent frame rate if you’re willing to upsize them a little.


Do you have a render?

Here are links to videos of it running in both 3D and 2D. Would’ve posted 'em earlier, but uploading is crazy slow here tonight.