This page contains code from some previous personal projects, course projects, as well as patches to some open-source programs I've used extensively. The page is still in the process of being "ported" to the current (new) website.

Quick index: course projects / Python code / patches / ancient scraps /

Course projects

A couple of fun and nifty projects from computer graphics & animation courses I took:

(mostly) Python code


ann-python.tar.gz: simple set of Python bindings for the ANN library (approximate nearest neighbour). Read the README file inside the tarball for instructions on building and using the library.


arcball.py: defines a subclass of 'Opengl' widget that supports the use of arcball method of rotation, which is frequently used in the graphics field. Run the script to see a very rough and quick demo. You'll probably want to bring up a different pyopengl app to compare the rotation methods.

Arcball summary: one of the main benefits is that it has no hysterisis: once you start dragging out a rotate, coming back to the same spot with the mouse cursor always gives the same rotation, no matter what path was taken to get the cursor to that spot. Also, if you drag the rotation outside the ball's perimeter (alas, it is currently not drawn; it's on the TODO), the axis of rotation is perpendicular to the screen/projection surface.


tkwallpaper.py: a silly wallpaper rotater utility. This is a Python rewrite of a TclTk older version: tkwallpaper


obb.py: a quick implementation of collision detection for OBBs (orientable bounding boxes). This module makes use of a quick-n-dirty vector module, provided below.


vector.py: a quick'n'dirty implementation of 3D vector class, and the usual vector operations found in graphics, etc.


point_in_polygon.py: a Python-translation of "point in polygon" test code by softSurfer.


TODO: not yet packaged. This will be: a simple set of classes for using 2D flavour of CSGs (computational solid geometry) in graphics. Supports containment testing (i.e., "in"/"out"), and rendering using pyopengl (using OpenGLs' winding rules for polygons).


This is probably one of the first programs I wrote for OpenGL. It's an imitation of SGI's "mailbox" command. It's a mail arrival notification program that uses pretty (uhm... it's rather debatable whether this implementation is pretty) 3D pictures and animation to show the status and contents of your email inbox.



icewm is a Linux/UNIX window manager.
  • icewm-lock-taskbar.patch: if like me you use the taskbar autohide feature but want to leave it up sometimes, "Ctrl+Shift+Alt+Space" locks the taskbar in the unhidden state; pressing the combo again unlocks it, putting it again under the control of the autohide code. (patch for icewm 1.0.3)


dosemu is a Linux/UNIX emulator of MS DOS.
  • dosemu-mouse.patch: fixes the mouse settings so the mouse has proper range in some DOS games in dosemu (such as Ulitma 6, Dune 2, etc.; without this patch the mouse cursor is limited to the left half of the screen). This should hopefully be fixed in the next DOSEMU, albeit in a different matter: by letting the user tweak some of the mouse parameters directly.


mutt is a Linux/UNIX mail user agent.
  • mutt-bold-folders-wnewmail.patch: folders and/or mailboxes with new mail are highlighted with the "bold" style in the folder/mailbox browser. Apply against mutt 1.5.3i. Tested against Debian's build of mutt (which includes some patches on top of the vanilla sources).

    The patch can be trivially modified to use any other (possibly new?) color pair instead of MT_COLOR_BOLD.

    Note that the approach taken in this patch is a bit kludgy due to a limitation in the "menu_t" structure. A more reasonable implementation would have menu_t's "color" function take a pointer to the menu itself, in addition to the item's index. This extra information could then be used by the "color" routine to compute the item's color on the fly, without the need of the current preprocessing.

    Make sure that you actually set the bold color to something in your mutt configuration file. E.g.

    color bold brightwhite default
  • pyurlview.py: a more capable replacement for mutt's "urlview".


Album is a neat utility that prepares themable web albums of your photo collections, including thumbnails. For an example, visit my gallery of photos.

Ancient scraps

This section holds links to some really ancient stuff I did, which might be still of interest to some. Most of these projects did not get the love they needed to get completed. :|
  • tkdiff: present graphical representation of the 'diff' of two files; much better alternatives out there -- my fav being `ediff' mode in emacs.
  • xaxo: a (long way to go) game for X11; RPG/adventure a la Ultima 6; only a world displayer so far; uses axonometric projection (à la XCOM)
  • tkpppload: displays traffic over your ppp link; much better stuff can now be found with KDE or GNOME.
  • updatesig.pl: a Perl script that updates your `.signature' file with a new quote every time (go here for my current crop of quotes).
  • sendwebpages: I used this to update the web pages on the school server using those on my home computer as the source; I now use `rsync' -- it's a million times better.
  • TkPaint: a paint program (specially suited for game developers), roughly based on D*luxe Paint IIe; project retired; with GIMP around why would anyone want anything else?