Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I understand that the following math topics are required for 3D graphics programming. I have started doing some of them in my math course. Can someone point me in the direction of a resource that explains how they apply? What graphics/game problems are they used to solve?

  • vector math
  • matrix math
  • quaternions
  • linear algebra

As far as I can see these are all linear algebra/matrix topics. Are there any other topics required?

share|improve this question
    
This question has some good info on that: gamedev.stackexchange.com/questions/2029/… –  michael.bartnett Apr 20 '11 at 15:24
    
@beardcp I might go as far as duplicate. –  The Communist Duck Apr 20 '11 at 19:29

6 Answers 6

up vote 8 down vote accepted

Linear Algebra is the foremost discipline for 3d graphics programming simply because it's the mathematical language for describing spatial geometry. Your other three topics are really just subsets of linear algebra:

  • Vectors are a way of thinking about points in space
  • Matrices are ways of thinking about transformations of space and objects: translating objects, scaling them, etc.
  • Quaternions are a natural representation for a specific subgroup of those transformations, the rotations
  • etc, etc.

As far as other relevant pieces of mathematics for 3d graphics programming, the one I'd recommend that doesn't get nearly enough love is computational geometry. A lot of natural problems boil down to topics in computational geometry:

  • One of the most natural ways of defining a volume from a set of points (for instance, to define an audio volume where a specific background noise will play, or a fog volume, or the like) is to find the Convex Hull of the points; there are good algorithms for doing that in 2 and 3 dimensions, but even the 2d algorithms aren't immediately obvious.
  • The problem of being able to determine what objects are near a given point or are near each other (for instance, to reduce the number of objects that have to be checked for possible collisions, or to figure out which enemies will notice the players at a given point) gets into the field of Geometric query problems and to spatial partitioning schemes (and thus into structures like BSP trees and octrees). The same general ideas are also used to answer 'line tracing' queries (for instance, 'what does this laser beam hit?')

After that, I'd encourage looking into basic calculus and particularly numerical methods for differential equations; these are less relevant to 3d graphics per se than they are to 3d physics, but in general the two topics are pretty tightly coupled (even for simple problems of kinematics - for instance, for character animations and the like) and some knowledge of both will substantially enhance your knowledge of either; it's difficult if not impossible to work the relevant physics without the same core linear algebra knowledge as graphics uses, but at the same time having the physics knowledge provides another point of reference for understanding the topics in graphics.

share|improve this answer
    
This was a fantastic answer, Steven, thank you. I loved your summaries of how to think about vectors, matrices and quaternions (sadly, more informative in 2 seconds than my current linear algebra lecturer) You have also given me a better understanding of the kinds of modelling challenges posed to 3D graphics programmers. Cheers! –  Katherine Rix Jun 9 '11 at 9:10

Here's a great intro http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-2/

share|improve this answer
    
Ah, from the guys who did Lugaru! I have not had a chance to read through this yet, but I have a 6 week vac now and this will be part of what I take a look at - thanks! –  Katherine Rix Jun 9 '11 at 9:15

http://www.dickbaldwin.com/KjellTutorial/KjellVectorTutorialIndex.htm is a pretty good and straightforward tutorial about 2D/3D vector math AND it's applications on graphics programming.

share|improve this answer
    
I've had a look at this, very nice. Starts with the basics which is good for a beginner like myself - thumbs up! :) –  Katherine Rix Jun 9 '11 at 9:11

They are not all required. Vector maths are all over 3D graphics, you might be able to set up the geometry without knowing the finer points of vector maths, but stuff like bump maps are going to get really hard, and you'll fall through on physics.

Quaternions simply offer a different description for some of the maths, it may be nice to have, but it's certainly not needed as more conventional mathematics suffice for describing any calculation you can do with quaternions.

Matrix maths and linear algebra are very closely related, most of all it describe linear operations on sets of numbers. But again, it's just another way of describing some things that could be described with vectors and algebra.

I don't know if you consider it to be just a part of basic maths, but trigonometry certainly needs to make the list as well.

share|improve this answer
    
I've seen a few mentions of physics so far - can you tell me what conecpts you are referring to here? I haven't touched the subject in 12 years (ie since high school) and frankly I hated it. Perhaps I will find its application easier to stomach though. –  Katherine Rix Jun 9 '11 at 9:20
    
Newtonian physics, primarily collision resolution. You might not have been taught this stuff in high school, but it's all very mathematical, so if you just like maths you should be good. –  eBusiness Jun 9 '11 at 12:33

Practical Linear Algebra and Fundamentals of Computer Graphics are two very good books that will cover the topics you mention (and their use within computer graphics), if you're in to books and such.

share|improve this answer
    
I am very into books and such :) Thanks for the recommendations. –  Katherine Rix Jun 9 '11 at 9:18

If you are familiar with Cartesian coordinates, then the application of the above topics to computer graphics should be pretty clear. There are tutorials such as these for OpenGL that will help to clarify the application of math to solving basic display problems, e.g. how to make a wire-frame model appear to rotate. The Wikipedia article on perspective drawing might help with a bit of historical background.

Beyond that there are many display topics that benefit from mathematical formulation. For example, 3D solids are usually represented by triangulations of their surface. How do we show only that part of the surface that an observer "should" see (hidden surface/line algorithms)? If an object is to be illuminated from a particular source/direction, how does this interact with perspective to give a convincing surface rendering?

Beyond that there are all sorts of interesting modelling topics, such as animation of a mist or a flame. But the transformation of coordinates, as your list of topics seems to center on, is a staple of all later advances.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.