Maths

Maths for Game Developers

Edit on Github | Updated: 9th August 2026

Vectors

Matrices (Matrix)

For an introduction to matrices we have a post on that topic:

View Projection Matrix

Reversing The ViewProjection Matrix (Game Engine Reversing)

The zero-irp blog features a comprehensive series by z1rp on the advanced topic of game engine reverse engineering, focusing specifically on dissecting the construction of the View-Projection Matrix.

This multi-part write-up systematically covers the foundational math of 3D transformation matrices (View and Projection), techniques for finding and reversing these matrices in a running game, and detailed analysis of SIMD instructions for matrix math. The series concludes with applications like trampoline hooking to capture entity positions and explaining World To Screen (W2S) transformations.


Quaternions


Harmonic Analysis

Harmonic Analysis is a major area of mathematical analysis that focuses on how functions—whether they are signals, images, or sound—can be decomposed and reconstructed using simpler, oscillating building blocks like sine and cosine waves.

How I released a game that has no assets using Sine Waves

In this project, Zanzlanz builds a fully functional game, Crow Sign, without using any traditional image, audio, or animation assets. Instead, the game generates all graphics, sound, music, and gameplay loops in real-time using sine waves and Fourier transform principles. The result is a highly compressed, mathematically generated experience that demonstrates the creative potential of fundamental wave physics in game development.

Here are the key techniques used by the developer:

  • Fourier Transform: This is the core algorithm used to convert shapes and audio into frequency data, essentially breaking down complex inputs into a series of sine wave frequencies.
  • Discrete Cosine Transform (DCT): Used in the game’s in-game JPEG shader to simulate image compression by converting pixel groups into sine waves and discarding less important frequencies.
  • Frequency Modulation (FM) Synthesis: Used to create complex sound effects, such as simulated noise and instrument textures, by modulating the pitch of one sine wave with another.
  • ADSR Envelopes: Applied to audio to control the volume shape (Attack, Decay, Sustain, Release) of sound effects like balloon pops.
  • Hyperbolic Tangent: Employed to create the specific infinitely squished visual effect seen in the mini-map and heads-up display, drawing inspiration from MC Escher.

All Posts

Maths
Matrices (Maths for Game Developers)

Introduction to Matrices A matrix is a table of numbers, but in game code the important part is what that table does 1.

Matrices let engines package translation, rotation, scale, camera transforms, and projection into a form that composes cleanly... ...

Maths
Quaternions (Maths for Game Developers)

Introduction to Quaternions A quaternion is a four-number rotation representation, usually written as { x, y, z, w } or as a vector part plus a scalar part 1.

In game code, the main reason to care about quaternions is... ...

Maths
Vectors (Maths for Game Developers)

Introduction to Vectors A vector describes magnitude and direction 1.

In game code, that usually means a small structure such as Vector2 or Vector3, but the storage type is only the implementation detail.

The useful part is that a vector... ...