Essential Math for Games Programmers

## Current Description

As the quality of games has improved, more attention has been given to all aspects of a game to increase the feeling of reality during gameplay and distinguish it from its competitors. Mathematics provides much of the groundwork for this improvement in realism. And a large part of this improvement is due to the addition of physical simulation. Creating such a simulation may appear to be a daunting task, but given the right background it is not too difficult, and can add a great deal of realism to animation systems, and interactions between avatars and the world.

This tutorial deepens the approach of the previous years' Essential Math for Games Programmers, by spending one day on general math topics, and one day focusing in on the topic of physical simulation. It, like the previous tutorials, provides a toolbox of techniques for programmers, with references and links for those looking for more information.

Topics for the various incarnations of this tutorial can be found below. Sample code libraries and examples are provided for certain talks.

## Current Materials

### Slides

The latest available versions of the slides for the math tutorials at GDC 2015 are as follows:

Doing Math with RGB (and A) Correctly (Jim Van Verth)
Fast and Funky 1D Nonlinear Transforms (Squirrel Eiserloh)
Game Math Case Studies (Eric Lengyel)
Implicit Geometry (Graham Rhodes)
Inverse Kinematics Revisited (Gino van den Bergen)
Parallel Random Generator (Manny Ko)
Understanding Homogeneous Coordinates (Squirrel Eiserloh)

Math Microtalks:

See below for further materials from past years that may be useful. The code samples in particular contain code for simple dynamics and collision.

## Past Materials

Presentations for the math tutorials at GDC 2014 are as follows:

Grassman Algebra for Game Development (Eric Lengyel)
Random Numbers (Squirrel Eiserloh)
Working with 3D Rotations (Stan Melax)
Inverse Kinematics (Gino van den Bergen)
Spatial Subdivision (Graham Rhodes)
Introduction to Frames, Dictionaries and K-SVD (Jim Van Verth)
Dictionary Learning in Games (Manny Ko)

Presentations for the math tutorials (the physics presentations are available here) at GDC 2013 are as follows:

Interpolation and Splines (Squirrel Eiserloh)
Matrix Transformations (Squirrel Eiserloh)
Understanding Quaternions (Jim Van Verth)
Dual Numbers (Gino van den Bergen)
Orthogonal Matching Pursuit and K-SVD for Sparse Encoding (Robin Green and Manny Ko)
Computational Geometry (Graham Rhodes)
Interaction with 3D Geometry (Stan Melax)

Presentations for the math and physics tutorials at GDC 2012 are as follows:

Interpolation and Splines + demo (Squirrel Eiserloh)
Understanding Rotations (Jim Van Verth)
Dual Numbers + source (Gino van den Bergen)
Computational Geometry (Graham Rhodes)
Math for Gameplay Programmers (John O'Brien)
Data Oriented Design (for Math) (Mike Acton)

Collision Detection (Gino van den Bergen)
Solving Rigid Body Contacts (Richard Tonge)
Diablo 3 Ragdolls (Erin Catto)
Tackling Physics (Stephen Frye)
Fluid Techniques (Jim Van Verth)
Destruction (Erwin Coumans)
Towards a Large Scale Simulation (Takahiro Harada)

Presentations from the physics tutorial at GDC 2011 are as follows:

It's All Relative (Squirrel Eiserloh)
Numerical Integration (Jim Van Verth)
Collision Resolution (Gino van den Bergen)
Game Physics Artifacts (Erwin Coumans)
Networking for Physics Programmers (Glenn Fiedler)
Soft Constraints (Erin Catto)
Smoothed Particle Hydrodynamics (Kees van Kooten)

Presentations from the physics tutorial at GDC 2010 are as follows:

2D Physics (Squirrel Eiserloh)
Collision (Erwin Coumans)
2D GJK (Erin Catto)
Fluid Techniques (Jim Van Verth)
Networking for Physics Programmers (Glenn Fiedler)

Presentations from the math and physics tutorials at GDC 2009 are as follows:

Basic Vectors and Matrices (Marq Singer)
Affine Transformations (Jim Van Verth)
Curves and Interpolation (Squirrel Eiserloh)
Orientation and Quaternions (Jim Van Verth)
Geometric Primitives and Proximity Queries (Marq Singer)
Numeric Precision (Christer Ericson)
Integrators (Erin Catto)

Topic Overview (Squirrel Eiserloh)
Anatomy of a Physics System (Erwin Coumans)
Collision Detection (Gino van den Bergen)
Collision Response and Constraints (Erin Catto)
Parallelizing the Physics Pipeline (Erwin Coumans and Takahiro Harada)
Networking for Physics Programmers (Glenn Fiedler)
Smoothed Particle Hydrodynamics (Kees van Kooten)

Fully updated versions of the slides and sample code used to present the tutorial at GDC 2008 are as follows:

Problem Overview (Squirrel Eiserloh)
Dynamics 101 (Marq Singer)
Numeric Integration Methods (Marq Singer)
Numerical Robustness (for Geometric Computations) (Christer Ericson)
Reframing the Problem (Squirrel Eiserloh)
Collisions using separating-axis tests (Christer Ericson)
Collision Detection (Gino van den Bergen)
Modelling and Solving Constraints (Erin Catto)
Physics Parallelization (Erwin Coumans)
GPU Physics (Marq Singer)

Fully updated versions of the slides and sample code used to present the tutorial at GDC 2007 are as follows:

Problem Overview (Squirrel Eiserloh)
Dynamics 101 (Jim Van Verth)
Numeric Integration Methods (Jim Van Verth)
Numerical Robustness (for Geometric Computations) (Christer Ericson)
Reframing the Problem (Squirrel Eiserloh)
Collisions using separating-axis tests (Christer Ericson)
Collision Detection (Gino van den Bergen)
Modelling and Solving Constraints & Contact Manifolds (Erin Catto)
Soft Body (Marq Singer)
Destruction (Marq Singer)
Squishing and Sound (Marq Singer)

Fully updated versions of the slides and sample code used to present the tutorial at GDC 2006 are as follows:

For those slides in PowerPoint Show format, the original PowerPoint materials are also available upon request.

In past years this tutorial was more general, providing a toolbox of techniques for programmers interested in improving their 3D background. The focus of the course was to follow the rendering and dynamics pipelines and show how problems along the way can be solved and optimized using 3D mathematical concepts. The following PowerPoint Show files and PDFs have been collated from all six years of the tutorial and organized by subject. They provide background material for those who are interested in the basics of 3D math and programming. The original PowerPoint materials are also available upon request.

### Demo Code

This collection of demo code is from the GDC 2005 presentation, and covers many of the topics listed above. The following archive has all the files you need to compile and run the demo code on Windows. You will need at least Microsoft Visual Studio 6. They should transfer to Microsoft Visual .NET with no trouble.
Windows 2000/XP Source

In the past we have supported the Mac, but at the moment none of us have a working machine much less one with MacOS X. The following files are provided for historical purposes only, and are no longer supported. You will need Codewarrior 6, at least MacOS 8, and the OpenGL SDK.
MacOS 8/9 Source

The copyright on these files is held by Red Storm Entertainment and Ubisoft. You can use them for personal purposes, but cannot redistribute them in source or binary form. No warranty is implied; use at your own risk.

For more polished code and demos with a less restictive license allowing them to be used in game development, and that can be compiled with non-Microsoft compilers, MacOS X, and Linux, please purchase a copy of our book.