• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

'Boing!' demo remake on Macintosh - such fluid animation

Mu0n

Well-known member
I came across this demo I had forgotten in some nondescript collection of graphics applications folders I had laying around. Some people in the Boston Computer Society took it upon themselves to recreate (in 1986) the 'boing!' demo from the Amiga which features a fake 3d bouncing ball animation, complete with sound, running in Workbench.

This fine piece of hackery involves color palette cycling to give the illusion that the ball is spinning on itself, so several areas of the balls are using the same colors spread out to distinct palette indices. By cyling the palette definitions around, the pixels are merely switching colors during a vertical blanking retrace instead of being calculated from a complicated linear algebra 3d transformation and some kind of raytracing 3d engine (wouldn't be possible on the original early 80's Amiga).

From a Macintosh standpoint, this is where it gets interesting. This was done fairly early in the black and white compact macintosh cycle (1986) so I'm not 100% certain the 'color' quickdraw palette was available. I half remember it was possible to set colored pixels in some apps that you'd still see in black and white on screen, but could be transformed into their proper color if you printed them with the appropriate colored ribbon printer. It's possible that the code used an entirely new data structure outside of quickdraw to deal with palette cycling, but I'm not solid enough on these matters where I could do my own code.

Still, with no special handholding done for you graphics wise (I'm thinking the lack of hardware sprite), it's quite remarkable that so many pixels are pushed so fluidly on this demo.

I made a small video about it if you want to see it in action, from a direct RGBtoHDMI video capture from my Mac Plus. I also included a bit on the Amiga version (emulated in WinUAE)
 

Crutch

Well-known member
This was a nice demo. The authors did a piece in MacTutor explaining exactly how they did it. There was no palette cycling before the Mac II in 1987 (that was indeed a nice easy to do very fast animation in color) but the Mac offered two screen buffers with instant switching between them on a VBL interrupt (as you suggest), which this demo utilized. As long as you can draw a full frame in the offscreen buffer in 1/60 second or less, you can get perfect flicker-free animation on a 128k, 512k, or Plus by just switching screen buffers on each retrace. I believe the SE (and certainly the SE/30) eliminated the secondary video buffer so this didn’t work on the later compacts.
 
Top