X-screensaver ports to Plan 9
Download: all hacks in a gzipped archive: xscr
News:
11/11/2007:
- Aki requested to add a benchmarking option. -b X will benchmark all hacks for X seconds
- New hack: boxfit
- New hack: interaggregate
- New hack: anemotaxis. Here's what the author has to say:
- New hack: pacman. As the name suggests, it plays a game of pacman. Use with -t to make it follow your mouse. Doesn't work well in drawterms (arc drawing problems).
- New hack: anemotaxis. Here's what the author has to say:
This code illustrates an optimal algorithm designed for searching a source of particles on a plane. The particles drift in one direction and walk randomly in the other. The only information available to the searcher is the presence of a particle at its location and the local direction from where particle arrived. The algorithm "explains" the behavior of some animals and insects who use olfactory and directional cues to find sources of odor (mates, food, home etc) in turbulent atmosphere (odor-modulated anemotaxis), e.g. male moths locating females who release pheromones to attract males. The search trajectories resemble the trajectories that the animals follow.
- No more flicker! I finally learned how to avoid that!
- Sped up (or made more colorful): whirlwindwarp, wander, petri, nerverot, mountain, interference, hyperglenda, hypercube, attraction, spirograph, slip, sierpinski, rorschach, pyro, hopalong, helix, demon, deluxe, anemone, deco, flow, cloudlife, halftone and glenda.
- New hack: lyap. It visualizes a Lyapunov exponent. Not very fast (compare with the original -- xscreensaver's 'xlyap'). A tad prettier than its xscreensaver parent, though :)
- Sped up hacks such as julia by introducing an intermediate image to draw to, instead of driving directly to the screen (less locking).
- New hacks: wormhole and fuzzyflakes.
- Munch now alpha-blended.
- Fixed scrdump to use interpolation code from resample(1), now the images look much better (but it's slower :). See this very beautiful screenshot.
- The following hacks' color palette was smoothed (instead of random):
- ccurve,coral,drift,fadeplot,flame
- New hack: starfish.
- Flow2 is now gone.
- All hacks now include plan9.h instead of defining things by themselves.
- Minor modifications to several hacks to make them more pleasant, cleaner or just right.
- Severely improved cloudlife's performance.
- New hack ready: vermiculate.
- New hack ready: cloudlife.
- Updated many hacks that lacked a proper flushimage().
- Julia now has proper colours
- Zoom now moves across the entire screen instead of just the top-left corner.
- New hack ready: glenda again a modification from hypercube. looks good only on fast displays (drawterm on hardware accelerated nvidia for example).
- Fixed flicker in hyperglenda.
- New hack ready: hyperglenda a modified hypercube for 9grid :)
- New hack ready: hypercube has very smooth rotation.
- Sped up the rd-bomb hack and added a smooth colormap. Unfortunately it sometimes breaks drawterm. Badly.
- New hack ready: demon.
- New hack ready: halftone.
- New hack ready: interference.
- Fixed a smooth-colormap issue with moire. Now the colors are much better looking and differ much less than the original xscreensaver ones. I needed this for the swirl hack (see next bullet), and had to backport it to moire -- it always irritated me. Note, if you still don't like the colors it's because they're converted through a CMAP8 colormap (corresponding to screen depth of 8 bpp).
- New hack ready: swirl. I think it's one of the coolest-looking hacks in xscr...
- Greatly simplified the screen grabbing routines --
getscr.[ch] are now replaced with a squeeze.h file which grabs
two images together and fits one to the other. To fit a
screengrab in a rio window therefore we just pass
display->image and screen to the routine. Very nice.
Hacks affected: scrdump, decayscreen, rotzoomer (rotzoomer is now much faster too), and slip. - New hack ready: deluxe.
- New hack ready: popsquares. This one has a few surprises :)
- New hack ready: zoom. This one has a few surprises :)
- New hack ready: forest.
- New hack ready: attraction.
- Added a '-c' (read 'continuous') option to scrdump -- now it takes a screendump every 1000 iterations, resulting in an almost-perfect 'picture in picture'. Worth for the hack value, only...
- Fixed squiral -- back when I did this hack I wasn't sure how much colors I want into this thing, so it was left b/w for the longest time. Now it's much better. It also resizes properly and clears the screen every 100000 frames :)
- New hack ready: pyro.
- Blaster now resizes properly.
- New hack ready: blaster.
- New hack ready: ripples. It draws to a screen offline and does a loadimage()/draw(), so it's fast over the network only when the window is reasonably small...
- New hack ready: moire.
- New hack ready: fluidballs. Not as good looking as I'd like, but fast. TODO: allow for a ball to be moved with the mouse.
- Also fixed a bug in the above -- for some silly reason i was offseting the window twice, so all balls bounced way before they reached the upper-left corner.
- Made galaxy coloured by default.
- Converted all code to the Plan9 identation style. Result not much better.
- Polyominoes now uses 'border' to draw the bounding box. I just learned about it today.
- Fixed 'anemone' to look more like the original. It is now faster too.
- Changed 'ifs' to use eruption's buffering method. Speed improvement (in a default sized window) -- from 7 to 15fps.
- Added new port -- Polyominoes (only colours, no bitmaps, but it looks great).
- Modified Eruption -- removed excessive calls to draw() with a loadimage() at the end. it's very fast until the image becomes too big and the network connection gets tapped. then it's slow again. (would like to know how it fares on native terminals!)
- Added new port -- Eruption.
Included here are several ports of the XScreensaver hacks to Plan 9... All programs are standalone and cannot, in their current state, be run as screensavers (i.e. they will not run in fullscreen mode, unless you resize them).
you can automate that by using the following invocation method (thanks to Russ Cox):
% fullscr=`{echo $vgasize | awk -Fx '{print "0 0 " $1 " " $2}'} % window -r $fullscr maze
The fullscr variable holds the coordinates of a rectangle the size of the entire screen, "window" then uses it to create a full screen window to run 'maze' in it. warning: may not work as expected in drawterm if you've resized it.
Compilation:
% hget http://mirtchovski.com/p9/xscr/xscr.tgz | gunzip | tar xv % cd xscr && mk % mk installThe files will be installed in $home/bin/$objtype/xscr; if you want to make a global installation just move them to $objtype/bin/xscr.
Note that not all of the hacks have been ported correctly -- some of the earlier ones lack color (strange.c), others have been modified slightly for lack of drawing primitives in Plan 9 (for example I had to guess what XSegments are, hence Euler2d looks slightly different than the original).
as usual -- suggestions fixes and comments are welcome...
Screenshots:
anemone.gif
anemotaxis.gif
attraction.gif
blaster.gif
boxfit.png
ccurve.gif
cloudlife.gif
coral.gif
critical.gif
decayscreen.gif
deco.gif
deluxe.gif
demon.gif
discrete.gif
drift.gif
eruption.gif
euler2d.gif
fadeplot.gif
flame.gif
flow.gif
fluidballs.gif
fuzzyflakes.gif
forest.gif
galaxy.gif
glenda.gif
halftone.gif
helix.gif
hopalong.gif
hypercube.gif
glenda.gif
imsmap.gif
interaggregate.gif
interference.gif
ifs.gif
julia.gif
lyap.gif
maze.gif
moire.gif
mountain.gif
munch.gif
nerverot.gif
../pacman/pacman.png
pedal.gif
petri.gif
polyominoes.gif
popsquares.gif
pyro.gif
rd-bomb.gif
ripples.gif
rorschach.gif
rotzoomer.gif
scrdump.gif
sierpinski.gif
slip.gif
sphere.gif
spirograph.gif
squiral.gif
starfish.gif
strange.gif
swirl.gif
thornbird.gif
triangle.gif
vermiculate.gif
vines.gif
wander.gif
whirlwindwarp.gif
wormhole.gif
zoom.gif
mirtchovski at gmail