Live data from Hacker News

The Amiga Boing Ball Explained

amiga.lychesis.net

61–65 of 65 posts

Re: The Amiga Boing Ball Explained

#61
post #2

Not explained whatsoever.

Ok, let me help. The Amiga has the ability to have bigger screens than the monitor can show at once. It can also move those 'screens' in any direction, and therefore show different bits of themselves on the monitor. Think of it like moving a slide around on a microscope, you can't see the whole slide at once through the eyepiece, so you move it around.

The Amiga can also overlay these screens on top of one-another, letting bits of the lower screens show through the transparent bits of the upper screens. For a real-world example, think of two clear plastic overhead projector sheets, one on top of the other. The top one is just the ball, and the bottom sheet is the grid. By moving the top sheet around, you create the effect that the ball is bouncing around the grid.

To emulate the ball rotating, the Amiga used one of it's other graphical tricks: palette cycling. The ball is actually made up of many thin strips of colour. Think of these strips as Colour1 to Colour30, all of the colours are painted white, except for a few evenly spaced red ones. To make the ball 'rotate' the colours assigned to Colour1 thru Colour30 are shifted one place to left (or right) a few times a second. This created the illusion that the ball is rotating, when in fact it's not.

All of this is done via hardware routines in the custom graphics chip, and uses almost no CPU time at all. It may not have been done how people think it was done, but it was still an impressive demo of the hardware regardless.

Basically, it's all smoke and mirrors, and please ignore the man behind the curtain.

Re: The Amiga Boing Ball Explained

#62
post #58
post #50

Earlier quoted context omitted.

My memory of the era is that no one would have thought they were actually 3d rendering in real time: that was Just Not Possible. I'll point out that once they finally, FINALLY made a memory card for the Commodore 64, that plugged into the megabyte-per-second DMA port, there was a similar bouncing ball demo done for the C-64. Purely by loading whole frames into the memory card and blasting them onscreen as needed, lik…

Yep. Every computer of the era ended up with a boing ball clone - it was just that iconic. [0] [0] https://www.youtube.com/watch?v=fSwwqt3ue2M

Here's one for the Amstrad CPC, where you can see the ball actually being drawn in all its 16-colour palette glory:

https://www.youtube.com/watch?v=m9Go8cwSDzQ

Re: The Amiga Boing Ball Explained

#63

Earlier quoted context omitted.

It might be obvious from the name, but there's also just one bit per pixel in a bitplane, and then you stack five bitplanes to get 32 colors. You can have different offsets into each bitplane, which is why the grid could stay in the same place while the ball bounced. The Amiga only supported bitplanes and not "chunky" modes like VGA where you have one byte per pixel. This made graphics with 256 colors (supported by t…

The offsets were measured in bits rather than bytes? That must have been a lot of engineering work.

Not particularly. Think of the display as a "stack" of monochrome one-bit-per-pixel images. Then bit offsets become completely natural.

Re: The Amiga Boing Ball Explained

#64

In what language is this animation written?

The program was written mainly in 'C' (some 830 lines of main program, with about 300 lines for the sound code). A small assembly language snippet provided the sine/cosine calculation code (about 100 lines, most of which contain the sine/cosine lookup table).

The setup for the animation and the background is quite clever and compact. The background is rendered first by drawing lines. Then the ball image (it's referred to as the "globe" in the code) is rendered, segment by segment, and for each segment, each facet of the ball is rendered as 8 strips. These are used for colour-cycling, giving the appearance that the ball is rotating.

The demo automatically adapts to PAL or NTSC, changing the aspect ratio for the background pattern and the ball. The sound effect of the ball hitting the correctly pans right and left as the ball moves around.

All setup and rendering operations are performed using operating system functions only.

Re: The Amiga Boing Ball Explained

#65
post #63

Earlier quoted context omitted.

The offsets were measured in bits rather than bytes? That must have been a lot of engineering work.

Not particularly. Think of the display as a "stack" of monochrome one-bit-per-pixel images. Then bit offsets become completely natural.

I was thinking in terms of word alignment and synchronisation issues.
Post reply on HN