Projects
This page catalogues several of my personal projects over the years.
Minimal CMake

Starting at the end of 2023, and over the course of 2024, I wrote a book about CMake. I was approached by Packt about writing a book about CMake after they came across my cmake-examples GitHub repository. The initial idea proposed to me was to write a book about the parts of CMake to avoid 😅 but I instead suggested a book that would get to the best bits of CMake as quickly as possible, and show the evolution of an application from start to finish. This culminated in Minimal CMake and I wound up pretty happy with the end result.
I don't think anything quite prepares you for writing a book. It was a long slog, and it took up pretty much all my spare time in 2024, but looking back I'm glad I did it, and I wouldn't rule out writing another one at some point in the future (though likely not for a little while 😝).
You can buy the book on Amazon, or directly from Packt. There's an accompanying GitHub repository with all code examples from the book. Below is a little of preview of the application you'll build over the course of the book. It's a simple simulation of John Conway's Game of Life using SDL 2, bgfx and Dear ImGui.

I wrote a follow-up piece for Packt on Substack which is available here, along with an updated example of the Game of Life project to accompany the blogpost.
Wood Pasture Tool
Sometime around the beginning of 2022, my sister approached me about building a tool that could help with the planting of wood pasture. The plan was to plant a number of trees at various points on the farm she manages and she wanted a way to automate the placement/positioning of them. I said I'd see what I could do, and the result (after several months of building the app in my spare time), was the Wood Pasture Tool.
The Wood Pasture Tool is a cross-platform desktop application that allows you to import farm holding data, select a field (or create a custom boundary/area) and request a pseudo-random tree placement. There are parameters to control how far the trees should be spaced apart, and how far they should be from the fence line. Once you have a distribution you are happy with, you can export the points to a GPX format, and import them to Google Maps, or a GPS device (e.g. Garmin) to then know exactly where to plant the trees.

The app is still in pre-alpha (and development paused while writing Minimal CMake mentioned above), but I'd love to return to it at some point and see if more groups (farmers/foresters/land owners etc.) might be interested in using it to make their tree planting easier.
CMake Examples
CMake Examples is a GitHub repository I created cataloguing my experience learning CMake. I created it mainly for myself as a reminder of how to do certain things in CMake, but it wound up proving useful to a number of other people. At the time of writing it has over 1,200 stars on GitHub and it continues to grow and evolve as I learn more about CMake. It also directly led to the Minimal CMake book mentioned above.
# my favourite CMake script
cmake_minimum_required(VERSION 3.28)
project(example)
add_executable(${PROJECT_NAME})
target_sources(${PROJECT_NAME} PRIVATE main.cpp)
target_compile_features(
${PROJECT_NAME} PRIVATE cxx_std_20)
Math Libraries
For some insane reason I've written not one, but two math libraries (one in C++ with lots of template shenanigans, and one in plain C). It was a really fun experience to design an API I enjoyed working with and I've wound up using the libraries in a bunch of hobby projects for various things. The C++ library (called as) is slightly more mature, and has been through more iterations. The C library (called as-c-math) was created while working on the Pikuma 3D rasterizer course mentioned below, but with a few additions and updates (it also nicely distinguishes between points and vectors which turns out to be quite useful in practice).
For an incredibly brief intro to what the API looks like for the as
library, below is an example snippet of a second-order (quadratic) Bezier
curve.
inline as::vec3 bezier2(
const as::vec3& p0, const as::vec3& p1,
const as::vec3& c0, const float t) {
const as::vec3 p0c0 = as::vec_mix(p0, c0, t);
const as::vec3 c0p1 = as::vec_mix(c0, p1, t);
return as::vec_mix(p0c0, c0p1, t);
}
For as-c-math
, here is a snippet from some camera code
using the library to calculate a camera transform.
as_mat34f camera_transform(const camera_t* camera) {
return as_mat34f_mul_mat34f_v(
as_mat34f_mul_mat33f_v(
as_mat34f_translation_from_point3f(camera->pivot),
as_mat33f_mul_mat33f_v(
as_mat33f_y_axis_rotation(camera->yaw),
as_mat33f_x_axis_rotation(camera->pitch))),
as_mat34f_translation_from_vec3f(camera->offset));
}
1D Non-Linear Transformations
While searching through old game developer conference (GDC) videos, I stumbled across this fantastic talk given by Squirrel Eiserloh called Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations. I got a bit obsessed with the talk, and decided to implement all the curves and techniques mentioned in it. The result was a GitHub project showcasing all the various animations and curves. It formed the basis for quite a few more demos and experiments too, including marching cubes, camera movement and (re)orderable lists.






Hierarchy
Hierarchy was an experiment to create an efficient way to store and represent hierarchical data (the primary focus of which was displaying entities in a game editor). I created a library to handle storing the data with an API to display it, I then used that library in a few different scenarios (one using a console window shown below, another using Qt, and a further one using an immediate mode UI (Dear ImGui)).

Reverse Z
I got interested in the topic of reverse z (when doing 3D projection), and wanted a clearer explanation of both why it works, and how to implement it. I wrote a blogpost about the topic you can find here, and also created two repositories (one using OpenGL and another using Metal) to demonstrate the technique and clearly visualise what happens when it is enabled/disabled.


Handle Containers
After reading a brilliant post by Niklas Frykholm (Gray) about ID lookup tables, I wanted to implement
one myself to properly understand it. I wound up creating a simple proof
of concept version in C you can find here, and then a more fully featured one that uses C++ and handles arbitrary types. This led to a further idea to
create a packed hash table (essentially a regular unordered_map
whose keys map to handles,
which then map to values). It allows extremely fast iteration (the same as
std::vector
) and O(1) retrieval, at the expense of more
memory.
I wrote a blog post about the handle container, going into a bit more detail about the design decisions behind it. I also wound up using the C++ containers mentioned above extensively in the Wood Pasture Tool.
Below is a small sample of the API.
struct test_t {
int a = 0;
};
thh::handle_vector_t<test_t> handle_vector;
thh::handle_t handle = handle_vector.add();
// retrieve a value via a handle
handle_vector.call(handle, [](auto& value) {
value.a = 6;
});
// iterate through all values with a normal range based for loop
for (const test_t& test : handle_vector) {
test.a++;
}
Cameras
Over various projects, I've always wound up needing a camera of some sort. I thought it would be fun to create a small, simple camera class I could reuse whenever the need for one arose. The result was as-camera, a minimal way to represent a camera with pitch, yaw and roll, along with an arbitrary orbit point (supporting look-at and free-look behaviours).
The interface boils down to the following:
struct Camera {
as::vec3 pivot = as::vec3::zero();
as::vec3 offset = as::vec3::zero();
float yaw = 0.0f;
float pitch = 0.0f;
float roll = 0.0f;
as::affine view() const;
as::affine transform() const;
as::mat3 rotation() const;
as::vec3 translation() const;
};
To support different types of camera behaviors, I created a separate
library which builds on top of as-camera
called as-camera-input. It formed the basis of the new camera system that was implemented in
the Open 3D Engine Editor you can read more about here.
SDL, bgfx and Dear ImGui Starter
I thought it would be cool to create a starter template for creating 3D demos and applications that others might find useful. After spending a while getting SDL, bgfx and Dear ImGui all setup and working together for my 1D linear transformation project, I decided to extract the core pieces and create a stripped back template others could use and learn from.
The result was sdl-bgfx-imgui-starter. It works across macOS, Windows, Linux and also supports Emscripten to run in the browser. It's very basic, but has all the core building blocks you need to get started with SDL, bgfx, and Dear ImGui.

Perspective Projection Demo
I decided to learn the sokol graphics library, and after being inspired by watching an excellent Coding Adventure YouTube video about portals (more on this later), I got inspired to create an application to demonstrate perspective projection in action.
The result was a small demo to allow users to interactively visualize the effect of perspective projection on a simple model. It's possible to adjust the near and far clipping planes and the field of view to see how these adjust the transformation applied to the model.

Arcball
When playing around with gizmos, manipulators and the various ways to orientate objects in a scene, I stumbled across the fascinating arcball paper/article by Ken Shoemake. I found some examples of the technique, but they often didn't seem quite right, so I decided to see if could resurrect the original demo that accompanied the article in Graphics Gems IV.
The result was the small project shown below. It took a bit of work to convert the IRIS GL (OpenGL precursor!) API to Open GL 1.x calls, but it should more or less be a faithful representation of the original demo created by Ken Showmake back in 1992.


Software Rasterizer
In 2022, I discovered the excellent courses offered by Pikuma, and wound up completing the 3D software rasterizer course. It was a lot of fun, and led to the creation of as-c-math (mentioned above), which I went on to use in other projects.
The code is available here, and an example of the final scene is shown below.

Vulkan Experiments
I wanted to learn a bit more about the Vulkan API and how modern graphics APIs work, so over the course of several weeks I went through the excellent vulkan-tutorial and put together a simpler renderer that could handle drawing basic scenes. I ported the code to SDL 2 and a more C like API along with a host of other small updates and improvements.
A snapshot of instance drawing can be seen below, along with a simple scene.


Unity Portal Rendering
While working on The Room Three, we wound up implementing a portal effect for one of the level transitions, and I got really interested in the technique and ended up writing a blogpost about it and created a small Unity project demonstrating the effect. It was mentioned in the Coding Adventures: Portal YouTube video (specifically about using oblique projection to handle object clipping between the portal and the camera).

O3DE Writing
During my time at AWS, while working as part of the Open 3D Engine team, I wrote a weekly newsletter called ly-goodreads (the ly was originally for Lumberyard). Several of these articles ended up getting published to the O3DE blog and can be found below.
C++ STL Algorithms Series
A look at several particularly useful C++ STL algorithms, covering when and where to use them.
- C++ STL Algorithms Series - Part 1
- C++ STL Algorithms Series - Part 2
- C++ STL Algorithms Series - Part 3
- C++ STL Algorithms Series - Part 4
Google Test Matchers
A walk through how to leverage Google test matchers to author more robust tests.
CMake Essentials Series
An introduction to CMake I created for the O3DE community.