Recent ProjectsThese are some of my recent non-profit projects. | Current Project I've got a few things going on right now. For one, I'm working on a total rewrite of vlib for Windows. It has an OOP backend and renders images much faster than previous versions. I'm also extending the interface to allow new rendering features such as a programmable illumination model and anisotropic reflections. I'm also working on a secret personal project. Stay tuned! | | | vlib, 1999-2002 (C on Linux) vlib is a volume graphics API that I developed as part of my PhD work. I claim that this implementation of my API is still the highest quality and most feature-rich volume renderer that exists! It supports shadows, reflection and refraction through the usual principles of recursive ray-tracing, though the main difference between this ray tracer and popular surface-based ray tracers (such as POV-ray) is that mine doesn't do any surface intersection tests. That's because volume graphics doesn't have any explicit geometry. Confused? Try reading my PhD thesis. This implementation is entirely CPU bound so it's quite slow at rendering complex scenes, though it supports parallel rendering by virtue of the Parallel Virtual Machine (PVM). There's lots more information on the official vlib website. | | | Talker, 1997-1998, 2003 (C on Linux & Windows) A telnet-based chat program. When I initially learnt about sockets, I wrote a program to send "hello world" from one machine to another, and then immediately set about developing a full-blown talker which I hosted for a couple of years at Swansea University. Even though I missed some of my 2nd-year lectures and lots of sleep to work on it, it's still not complete, though I've recently improved it to compile and run on MacOS and Windows XP, in addition to its original intended platform, Linux. Any number of people can connect; the host reads what they type from their socket, processes their commands and writes back out to their terminals. | |
BSP Tree StuffWhen I wrote these, Binary Space-Partitioning (BSP) Trees made the world go round. Note that my B.Sc. dissertation has lots of background information on BSP trees, why not take a look? | SECARPE, 1998-1999 (C++ on Windows) This was the practical part of my 3rd year university project. SECARPE stands for System for the Experimental Construction and Rendering of polygonal Environments and comprises several software components including a random object generator, a 3D BSP tree compiler (the main focus), a mesh viewer and 3D renderer. The goal was really to study BSP tree compilation and to figure out a correspondence between input scene and output tree, and to decide which tree qualities (even balance, low node count, etc.) were important and why. My compiler includes a random mode which often "accidentally" generates far better trees than most deterministic compilers! | | | Pseudo3D, 1998 (C++ on Windows) My first work with BSP trees, Pseudo3D relies on the same principles as DOOM. A map is drawn using line segments, where each segment represents a wall in a maze. The lines are then carved up into a BSP tree (sometimes lines need to be split for this to happen, but no evidence of this is ultimately visible). A renderer (Pseudo3D) using this BSP tree then renders polygons with x and z coordinates defined by the line segments and fixed y coordinates. BSP trees allow fast depth sorting of polygons, in O(n) time in fact. Pseudo3D is so-named because the nature of the 2D map does not allow tunnels or bridges to be built, hence the virtual environment is not really 3D. SECARPE above uses 3D BSP trees. | |
DOS-based Graphics DemosI spent quite a bit of time writing small graphics demos in Intel assembler. What I particularly enjoyed was trying to squeeze out high frame rates on slow machines without any 3D hardware acceleration. I mainly used Mode 13h (320x200 8-bit colour) but occassionally experimented with Mode X, an undocumented mode supported by all VGA cards. | Wolfenstein Clone, 1997 Textured orthogonal walls. Run around using the cursor keys. Basic algorithm: cast one ray per screen column (i.e., 320) and compute the intersection between each ray and the closest wall. The map is closed so there will always be an intersection. The distance to the intersection point gives the height of the wall segment on that screen column; the point on the wall where the ray hit (in the x-direction only) is used as the texture index. Notice how the top and bottom halves of the screen are mirrors of each other. | | | Bump, 1996 Bump mapping. Move the light with the mouse to achieve the impression of a torch illuminating a carved object. A greyscale image is used as a heightmap. A lightmap is precomputed with a bright point at the centre fading out to darkness at the edge. Basic algorithm: for each screen pixel, calculate X and Y normal components for the corresponding heightmap pixel using central differencing and use these (and the distance to the mouse cursor) as an index to the lightmap. Plot the colour from the lightmap on the screen. | | | Tetris, 1996 No explanation needed! An outer loop controls the rate at which the pieces drop - it uses the system clock (always 18.2 ticks per second) to ensure the game runs at the same speed on all machines. An inner loop deals with rotating the pieces and moving and dropping them on command. The game increases speed every time 15 rows are completed, indicated by a change in background colour. Sprites are used for the score at the bottom. I got very addicted to this game after writing it - 24 hours to implement and 12 months to test!
Note I've since written a Tetris Applet! | | | Plasma, 1996 A static plasma with palette rotation creating a flowing effect. The screen is drawn just once by recursively subdividing into quarters and plotting the corner pixels of each section according to a simple function; recursion stops when all pixels have been drawn. The result is a continuous random cloud-like image. The palette is set up so that its colours form a smooth gradient, wrapping around from the end of the palette to the start. To animate the image, the palette is rotated, i.e., the colours are all shifted up by one (and the last entry is moved back to the start). The actual pixel values are not recomputed. | | | Mystify, 1997 A clone of the Windows screensaver. The palette is set up as for the Plasma demo and rotated so that the lines gradually fade through a series of colours. Each "shape" (here two are shown: one pink and one green) is defined by four points (each moving from one random point on an edge to another) and four lines connecting these points. The position of each shape is held for a few frames to create chasing shapes. | |
Text-based DOS ApplicationsBefore the graphical OS, man made DOS. | Member Manager, 1994-1995 I wrote this program for my A-Level and BTEC Computing courses. The BTEC version was written completely in COBOL but I ported it to Turbo Pascal (my preferred language at the time) for the A-Level project. MM is a gymnasium record handling system, completely unconfigurable (still, not to worry) but quite good at its job. It includes searching and sorting facilities, a demographic history of member records, report generator and various housekeeping tools. Lots of effort went into the presentation of the system as well as the features it provides. Later, I modified MM, renamed it Sermon Software and sold it to the church! | | | Application Engine, 1995 Although most people think that Turbo Pascal isn't object oriented, OOP support was actually introduced in version 5. Here's an object oriented engine for creating text-based DOS applications that Member Manager inspired me to write. It supports most common desktop controls including forms, buttons, scroll bars, checkboxes, labels and menus. The programmer creates a hierarchy simply by creating one object per control, inserting one or more of these objects into a parent object (e.g., a button into a form) and assigning event handlers where required. The engine then deals completely with event handling, focus shifting, control drawing, etc. | |
|