views:

657

answers:

4

I'd like to get an idea what kind of math is typically necessary for 3D game engine programming? Any specific math (such as vector geometry) or calculation algorithms (such as fast fourier transforms), or is this all abstracted away with DirectX/OpenGL so that highly complex math isn't really necessary any more?

+6  A: 

Matrices, trig, geometry mostly and a bit of linear algebra

Take a look here http://www.essentialmath.com/

Martin Beckett
And vectors, lots of vectors!
Marius
So many vectors... :(
Matthew Iselin
In fact, you can get rid of vectors, and there are certain important advantages to it. Tensors are nicer to work with.
ima
Vectors ARE first order tensors - there's no "getting rid" of them in favor of tensors.
duffymo
I left out vectors because it's a little confusing between c++ vectors (which are matrices) and physics vectors and geometry vectors
Martin Beckett
There is getting rid of matrices and vectors in favor of more abstract tensors and operators. Most importantly, it allows to define operations invariantly under basic transformations. When you throw in some physics to 3D engine, it greatly simplifies thin
ima
+1  A: 

Complex math comes in to play, but most important is an understanding of the concepts behind such math and often not the math itself. So long as you understand how it all comes together, there are often helper methods for many of the calculations you will need. Of course that depends largely on the development platform you are using as well.

Nathan Taylor
+2  A: 

For the most part linear algebra and computational geometry; Quaternions are used extensively and numerical analysis is necessary if you are working on a physics engine.

How much you'd use the stuff on a daily basis depends on what you are doing. If you are a graphics programmer, and therefore building the 3D graphics engine itself, then you would likely be implementing or maintaining implementations of class libraries and functions that actually do the math, so it would be relatively important to know the gory details. If you are using the library as client or working on another part of the game engine (AI, audio, UI, camera, etc.) then you will need to understand the math conceptually but you can certainly get away with not knowing how to implement a matrix inverse on a whiteboard off the top of your head.

Graphics APIs do not eliminate the need for someone to know this math; they are limited to drawing, so all the scene management and world simulation needs to be implemented outside the graphics API. Of course, there are middleware options there too but many studios roll their own systems.

There are a fair number of resources targeted at this market. For example, on Amazon there are books like 3D Math Primer For Graphics and Game Development, and there's probably a lot of stuff online too.

+2  A: 

Linear Algebra! Lots of lots of Linear Algebra!

Here are just classes and example situations where you need them

  • Vector - position, velocity, normals
  • Matrix - transformations
  • Quaternion - rotations (great for bone animations)
  • Ray - projectile collision detection
  • Plane - projectile collision detection
  • Frustum - render culling
  • Sphere - render culling, fast collision test
  • Axis-Align Bounding Box - culling, collision tests, spacial partitioning
  • Oriented Bounding Box - collision tests
  • Convex Hull - collision, spacial partitioning
  • etc.

You should start with Vector and Matrix as they will be used everywhere in the engine (graphics, physics, AI, etc.)

Aleks