Published on
Project Duration: 17 Nov 2025 – 28 Nov 2025

C++ Lindenmayer System Generator



Developed as an academic project for the Mathematics for Games and V/AR module during my MSc Computer Games Programming at Goldsmiths, University of London.

This project explores Lindenmayer systems (L-Systems) as a procedural generation technique for creating vegetation and other branching structures. The application provides an interactive 3D visualiser and configurable rule system intended as a starting point for 3D modelling workflows.


GitHub Repository · Academic Report


Video Demonstration


Overview

The project is based on the work of Aristid Lindenmayer and the use of formal rewriting systems to model the growth and structure of plants.

The application provides a 3D environment in which L-System rules can be configured, iterated, and visualised interactively. The resulting structures can be used as procedural starting points for vegetation modelling and other forms of branching geometry.

Rather than being a purely mathematical demonstration, the project was designed around a practical game-tooling pipeline, allowing generated structures to be previewed in 3D and exported for use in external modelling software.


Core Architecture

The application was written in C++ using OpenGL for rendering and ImGUI for the interactive editor interface.

The main technology stack consists of:

  • C++
  • OpenGL
  • ImGUI
  • GLFW 3
  • GLM
  • JSON
  • WebAssembly

OpenGL provides the 3D rendering layer, while ImGUI exposes the procedural generation controls and makes it possible to experiment with different L-System configurations interactively.


L-System Generation

The core of the tool is a data-driven implementation of Lindenmayer systems.

An L-System begins with an initiator and repeatedly applies a set of production rules to generate increasingly complex strings. These strings can then be interpreted as instructions for constructing geometry.

The application exposes the main parameters needed to control the generation process:

  • Initiator
  • Generator / production rules
  • Turning angle
  • Number of iterations

These properties can be modified interactively, allowing the effects of different rules to be observed immediately in the 3D visualiser.


Data-Driven Rules

L-System definitions are represented using JSON, allowing new systems to be created without changing the underlying C++ implementation.

This provides a separation between the procedural generation logic and the specific rule sets used to create a particular plant or branching structure.

Pre-configured examples can therefore coexist with custom user-defined systems, making the tool reusable for experimentation with different procedural patterns.


3D Visualisation

The generated L-Systems are rendered directly in a 3D environment.

Camera controls allow the user to navigate around the generated structure using familiar game-style controls:

  • WASD for horizontal movement
  • Space / Shift for vertical movement
  • Left mouse drag for camera rotation

This makes it possible to inspect generated structures from arbitrary angles and evaluate their shape before exporting them.


Interactive Controls

The ImGUI interface provides direct access to the procedural parameters while the application is running.

Controls are designed to be accessible both through the interface and through keyboard shortcuts, allowing users to quickly iterate on a generated structure without repeatedly navigating through menus.

This supports an experimentation-focused workflow where changes to the grammar can be made and immediately visualised.


Procedural Vegetation Pipeline

One of the main practical goals of the project was to demonstrate how L-Systems could be used as part of a procedural vegetation workflow.

The generated structures act as starting points rather than finished production assets. A modeller can use the exported geometry as a basis for further refinement in tools such as Blender.

This makes the system useful as a procedural pre-visualisation and content-generation tool rather than attempting to replace a full modelling package.


OBJ Export

Generated L-Systems can be exported as .OBJ meshes for use in external 3D modelling software.

This allows a procedural result to move from the C++ tool into a conventional content-creation workflow, where the generated geometry can be edited, refined, textured, and turned into a final production asset.

The OBJ export functionality is available in the native desktop builds. It is not supported in the WebAssembly version because the web deployment is not designed to provide the same filesystem access required for direct model export.


WebAssembly

The project also includes a WebAssembly build so that the visualiser can be run in a browser environment.

The web version provides access to the procedural generation and visualisation features, allowing the tool to be demonstrated without requiring a native executable.

The desktop build retains additional functionality such as OBJ export that is not available through the browser version.


Technical Challenges

One of the main challenges was translating the abstract structure of an L-System into a usable 3D representation.

The system needs to maintain the formal rewriting process while also interpreting the resulting symbols as spatial operations, including movement, orientation changes, and branching.

The project therefore combines mathematical rule processing with real-time graphics and interactive tooling.

Another important consideration was keeping the system data-driven, so that new L-System definitions could be introduced through JSON rather than requiring changes to the core code.


Tooling for Game Development

The project was designed specifically with game tooling in mind.

Rather than treating procedural generation purely as an algorithmic exercise, the application provides:

  • Interactive editing
  • Real-time visualisation
  • Reusable data-driven rules
  • 3D camera navigation
  • Procedural mesh generation
  • Export to a standard modelling format

Together, these features create a small but complete procedural content pipeline suitable for generating vegetation starting points and experimenting with procedural geometry.


Academic Context

This project was completed as Coursework 1 for the Mathematics for Games and V/AR module during my MSc Computer Games Programming at Goldsmiths, University of London.

The project provided an opportunity to apply mathematical concepts related to recursive and procedural systems to a practical game-development tool.

The accompanying academic report documents the mathematical basis, implementation, design decisions, and evaluation of the project in greater detail.

Read the full academic report →


Technical Details

Language: C++ Graphics API: OpenGL UI: ImGUI Windowing: GLFW 3 Math: GLM Data Format: JSON Procedural Technique: Lindenmayer Systems / L-Systems Visualisation: Interactive 3D renderer Export: OBJ Deployment: Native desktop and WebAssembly Project Type: Academic coursework Module: Mathematics for Games and V/AR Programme: MSc Computer Games Programming Institution: Goldsmiths, University of London


Project Outcome

The final result is an interactive 3D L-System generator and visualiser that demonstrates how mathematical procedural systems can be turned into practical tools for game development and content creation.

The project combines procedural generation, real-time graphics, interactive tooling, data-driven configuration, and mesh export into a single workflow.

It demonstrates how L-Systems can move beyond a purely theoretical implementation and become part of a usable procedural modelling pipeline for generating vegetation and other branching structures.


Development Period

November 17, 2025 – November 28, 2025

Academic coursework project — MSc Computer Games Programming