Skip to content

Frost & Fire






[Large still from Corona animation.]
[This image is a still from the Corona animation. Reload this page with Java installed to see an original animation.]

In 1989 I wrote a program that simulated video feedback to produce a pattern of reminiscent of paint swirling on a spinning piece of paper. This later shipped as a module for Berkeley System’s “After Dark” screen saver. The same effect (although doubtless not the same code) is used now as a visual effect in all the music managers — iTunes, Media Player, and so on.

I originally wrote the program because I was working on a fast bitmap rotation algorithm for Quickdraw GX. We were trying to get bitmap rotation working at reasonable speeds on the 68000 class of processors, with no hardware acceleration, at 20MHz. I heard that a new company called Live Picture was displaying rotated images at interactive speeds, so I rethought our algorithms from the ground up and came up with an application of the Bresenham line algorithm, simultaneously computing coordinates along virtual lines in the two spaces defined by (sourceX, destX) and (sourceY, destX) for each destination scanline, and using yet another pair of lines to update the endpoints of these two lines for each new scanline. This gave (un-antaliased) bitmap rotation at interactive speeds on stock hardware. (Later, I found out that Live Picture actually cached its rotated images, so the existence proof that spurred me to work on this wasn’t actually valid.)

I rewrote my program in Java five or six years later, and the interpreted Java version ran faster than the handcoded assembly version of 1989 did. Then I simplified the program by using floating-point numbers instead of fixed-point numbers, and it’s still faster. That’s what you see above. So there’s no longer any coding challenge in implementing this kind of thing, but it’s still a nice effect.