The Twirling Ribbons

We continue our popular series of particle animations with a whimsical new example. This time, the particles consist of line segments which rotate as they move. Small rectangles are drawn between the previous segment location to the new segment, thus producing the effect of ribbons being swept out in the trajectories. Click on the image below to open the applet in a new window.

Download

  • Download all the source files corresponding to this experiment: ribbons.zip

Check out other particle animations in the series:

Comments About the Code

As the ribbons explode out from a central location, their widths increase and then later taper back to zero. This is achieved by setting some “envelope” parameters for the line segment particles. This use of an envelope is similar to the envelopes used to control the changing size of the bubbles in our earlier Lorenz in Bubble Form example linked above.

The ribbons are colored according to two randomly chosen colors which determine a gradient. To achieve a depth effect, a ColorTransform is continuously applied to the picture to darken the previous image while the new portions are drawn. This darkening filter also has the effect of fading out the old picture to black.

We have simplified the code somewhat compared to our earlier examples, and have tried to include only the variables and methods required to achieve this particular effect. We hope the result is code that is easier to understand. Still, we have tried to maintain some flexibility in the code to allow for experimentation.

Back to Advanced Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.