software

I started programming when I was about 11, on a TRS-80, with a black and white screen, 64K RAM, casette tape storage, and a keyboard that gave an awful lot of tactile feedback. Below are some of the projects I've worked on since then that I enjoy remembering. They appear in reverse chronological order.


(September 2003) Here's an OpenGL hack made during an afternoon of procrastination. It's designed for my toddler, and intended to be run full screen. Moving the mouse rotates the cube, dragging the mouse scribbles on the surface of the cube, and hitting any key types letters on the cube that briefly oscillate in size before fading away. The space bar causes a random change in the colour scheme. Clicking and releasing a mouse button without dragging toggles a slow, animated rotation of the cube.

windows executable (.zip file)
C++ source code (requires OpenGL & GLUT)
sample ~/.xsession for a toddler's UNIX/Linux account


(January 2002) Reading input from the microphone on linux turned out to be surprisingly simple (at least on my Redhat box): simply open the file /dev/dsp and read a stream of unsigned bytes encoding an 8-bit raw signal. Below are plots of the raw waveform, the one-sided power spectrum, and a Symmetrized Dot Pattern (or "sound flake") as described in Clifford Pickover's "Computers, Pattern, Chaos and Beauty".

If you want to implement this yourself, get a passive microphone, plug it into the pink port on your soundcard, and try to get "rec" (a script that serves as a front end to "sox") to record something, and play it back with "play". If that doesn't work, it may be that your microphone is muted or disabled. Try running "aumix" (or maybe "xmix" or "smix") and select the microphone for reading.


(June 2001) As part of a graduate course, I implemented a simple 3D modeller that supports 2-handed interaction techniques.

report - source code - requirements: Unix / X11, OpenGL, GLUT


In an effort to explore the concept of collective creative spaces, I created a 3D virtual space on the web that visitors could post messages in.

more pics


(March 2000) What a fun way to waste computing resources: the game of life, on a wrap-around grid, projected onto the surface of a torus ! Depicted here, from two different camera views, is an army of "walker" patterns. If left undisturbed, the walkers endlessly march around along helical trajectories.


For my 4th year undergrad project, I implemented a virtual toy train set.

more pics - source code - requirements: Unix / X11 and OpenGL


Java has proven quite useful for implementing small, interactive, graphical toys.

examples - tutorial


Thanks to topology, we now know that spheres can be smoothly turned inside out. This OpenGL application aids in the visualization of sphere eversion.

pics and source code - requirements: OpenGL and GLUT


Below is a screen-dump of a text-based operating system, K-OS. It ran on a Motorola 68000. The window manager allows users to move, resize and shuffle windows using the keyboard. In the upper-right corner is an icon manager: Iconified windows have a '*' beside them, and the window with focus has a '>' beside it.

The applications that were written for K-OS include "mawm shell" (a command interpreter), a clock, and a 3D burr puzzle (not depicted below) which strained the limits of our 32K RAM.

Authors: Derrick Moser, Phil Armstrong, Brian Wong, Michael McGuffin.



--- K-OS v1.0 ----------- E&CE 354, Winter 1997 -------------+------------------
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::| >KTerm 04        
:::::::::::::::::::::+- KTerm 03 ------------------------+:::|  KTerm 03        
:::+- clock -----+:::|mawm shell : type man for help.    |:::|* KTerm 02        
:::|  2:34:17 pm |:::|+>                                 |:::|  clock           
:::+-------------+:::|                                   |:::|  KTerm 01        
:::::::::::::::::::::|                                   |:::+------------------
:::::::::::::::::::::|          ## KTerm 04 ################################::::
:::::::::::::::::::::|          #mawm shell : type man for help.           #::::
::+- KTerm 01 -------|          #+> man                                    #::::
::|mawm shell : type |          #clear            [wipe shell window]      #::::
::|+> &clock         |          #setprompt string [customize prompt]       #::::
::|+> &shell         |          #settime hh:mm:ss [set internal clock]     #::::
::|+> &shell         +----------#ls               [list runnable programs] #::::
::|+> &shell                    #ps               [list running processes] #::::
::|+>                           #program_name     [start in foreground]    #::::
::|                             #&program_name    [start in background]    #::::
::|                             #kill 0xPID       [terminate process]      #::::
::|                             #exit             [quit shell]             #::::
::+-----------------------------#+> _                                      #::::
::::::::::::::::::::::::::::::::#                                          #::::
::::::::::::::::::::::::::::::::############################################::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

My first OpenGL program was for visualizing the shape of a solenoid. A torus can be successively twisted and folded to produce increasingly better approximations of a true solenoid. The mesh representing the twisted torus is generated using a simple formula given in §24.2 of Clifford Pickover's Computers and the Imagination.


After my first year of university, I became acquainted with Unix and Xlib. Soon after I created a program for drawing the Mandelbrot fractal. The user can zoom in with the mouse.

source code - requirements: Unix / X11


These are DOS screen shots of my project for the 1994 Regional Science Fair, written while I was at cégep (Quebec's version of grades 12 and 13). The input is an orthographic drawing of a polyhedron with faces that all meet at right-angles. The output is the deduced 3D structure of the object, displayed as a rotatable wireframe. This is a very simple "machine perception" program, where the computer tries to reconstruct the hidden edges of the object. It was inspired by an article by David L. Waltz in the October 1982 issue of Scientific American, which describes an edge and vertex labeling scheme pioneered by David A. Huffman and Max B. Clowes.

more pics

 

 

Here are some game-playing programs for Windows 3.1. The first plays 3D tic-tac-toe against a human; it can only be beaten if the player discovers a subtle weakness in the program's strategy. The second plays a minesweeper-like game by itself, attempting to deduce the locations of mines and free squares. "X" denotes known mines. Yellow letters indicate what the program has deduced: "M" means a mine must be under the square, "D" means the square can be safely uncovered ( découvert ).

Windows 3.1 executables: 3d tic-tac-toe - mine sweeper solver


This output is from a bare-bones ray tracer written in high-school. The scene was hardcoded, and the source code totalled about 200 lines. Only spheres could be rendered.

source code - written for DOS


This program tries to tesselate a finite region of the plane with Raphael Robinson's set of 6 tiles. Robinson's tiles can only tile the plane in a non-periodic way (rotation and reflection of the tiles are allowed).

The program works by creating a 2-dimensional array corresponding to tile positions on the plane. Each element of the array contains a list of all possible tiles in that position, except for odd-odd elements which are constrained to contain the black tiles. The program then performs constraint propagation, looping like this:

This algorithm was rather time consuming, even for small regions of the plane, when run on a 16 MHz Intel 386. I have since learned there is a much more straight-forward algorithm for tiling the plane with Robinson's tiles (see Undecidability and Nonperiodicity for Tilings of the Plane by Raphael M. Robinson, in Inventiones Mathematicae, vol. 12 (1971), pages 177-209).


In 1993 I wrote a program to simulate a pendulum attracted by two magnets. Each pixel represents a starting point for the pendulum, and the pixel is coloured according to which magnet the pendulum ends up "sticking" to. If the pendulum is started near the center between the two magnets, sensitivity to initial conditions increases. The below image was produced on a 386 after many hours of computation.

6 years later, I ported the code to X11 and ran it on an SGI. Below is the result of zooming in a few times. As can be seen, this fractal has a most boring scale invariance.