home page icon Flash Bestiary / Physics / Wheel of Trinkets
   

Wheel of Trinkets

This movie is a (significant) modification of the previous movie (clumping). Here I'm using a simpler collision algorithm that doesn't allow the balls to intersect at all, and I'm keeping them inside a rotating circle with gravity.

Why? I'm trying to figure out the physics behind a kaleidoscope object cell. In nicer kaleidoscopes, you are looking at an oil-filled chamber filled with trinkets.

This is a 2d-representation of a kaleidoscope object cell (without the kaleidoscope effect). I intend to make an OpenGL version of this program, using 3D physics, which will make for a very realistic kaleidoscope simulation.

UPDATE: The source code below now contains an Actionscript 3 version, in addition to the original Flash MX code. The algorithm runs faster in AS3, so I've increased the number of balls. I did indeed port parts of this code to C++ to generate a set of OpenGL kaleidoscope screensavers, some years back.

 

sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Springy Thingies

Having trouble opening the project? You may need to Upgrade to Flash CS3



Copyright © 2003,2008 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback