Re: Animation (was Re: (Q) Keeping copies of drawing areas)

Niels P. Mayer (mayer@netcom.com)
Wed, 22 Jun 94 03:01:58 -0700

From: Guido.van.Rossum@cwi.nl
|> Here's an example simple animation using WINTERP 2.0 and the Xtango
|> graphics/animation package. It presents an animated "towers of hanoi"
|> game/algorithm with the disks smoothly stacking and unstacking between
|> three "pegs" while a large GIF remains displayed in the background ...
|
|I'm sure the same can be done in Python/Tk with less code. Anyone feel
|challenged?

Less code, perhaps, yes, perhaps no. But does it give the same results
in terms of smooth animation? I don't need to specify anything other
than starting and ending locations to make the discs smootly slide up
the pegs, arc across to another peg, then slide down the destination
peg. All intervening frames of animation between destination positions
are taken care of by the system, within the C primitives. And all of
this occurs on top of the background GIF without flicker and without
having to worry about redrawing damaged areas on the backround nor the
"stacking pegs" which the discs are sliding up and down....

Yes, I'd love to see how python/tk handles this in less code.

Other properties to force a fair comparison is to what extent the
python/tk code cleans up after itself. If the user closes the
tango/animation "window", all memory associated with it, including the
GIF pixmaps, the colors allocated for the GIF, animation paths,
transitions, images, etc are all automatically cleaned up by the
garbage collector. Since you can run many applications in one 'winterp'
process, this sort of thing is important...

Finally, the Motif part of the system has more functionality than meets
the eye. Menus are all keyboard sensitive via mnemonics. Traversal of
the menu system can be done entirely through the keyboard if one so
desires. This "window dressing" represents a good 40% of my code, so
any fair comparison should at least have a menubar and a message area
which displays instructions and status to the user.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
== Niels Mayer -- netcom!mayer -- mayer@netcom.com ==
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=