Basic 3D Math I would need to know before doing Graphics Programming or XNA

Started by
4 comments, last by Zakwayda 13 years, 3 months ago
What are some basic concepts and/or maths a programmer should be familiar with before getting deep into XNA, D3D, or OGL?

I've scoured the internets, but I just don't want to be randomly learning (unnecessary) things.

Beginner in Game Development?  Read here. And read here.

 

Advertisement
For the majority of game development tasks, you can get by with:

- Basic trigonometry (sine, cosine, inverse sine and cosine, etc.)
- Basic vector math (arithmetic operations, dot product, cross product)
- Basic understanding of coordinate spaces and transforms (scaling, rotation, translation)
- Understanding of how matrices can be used to represent transforms and to apply them to points and vectors

People often say you need a good understanding of linear algebra, but while that's not necessarily untrue, the basic stuff you need to know for game development (that is, basic vector and matrix math) is only a relatively small subset of what linear algebra encompasses (in other words, there's a lot covered by linear algebra that's not needed for basic game development).

Quaternions would probably be among the next items on the list, but they're usually more of a convenience than a necessity. In any case, it's best to develop a good understanding of matrix and vector math and transforms in general before tackling quaternions, IMO.

Once you get past the basics, it just depends on what problem(s) you're trying to solve (depending on the task, you may eventually need advanced linear algebra, calculus, etc.).

I know there are some other good books as well, but the book I always recommend is '3D Math Primer for Graphics and Game Development', as it does an excellent job (IMO) of covering the basics clearly and succinctly.

One other heads up: Make sure you understand the following terms, and the differences between them:

- Row- vs. column-major matrix storage
- Row vs. column vectors
- Left- vs. right-handed coordinate systems

There's a lot of confusion regarding these topics. The first items (matrix storage order and vector orientation) are often confused with each other, and sometimes handedness is confused with either or both as well (e.g. 'the translation is on the bottom row because the coordinate system is left handed'). However, they are all separate, distinct issues (although they do interrelate somewhat).

You may already know all this and are maybe looking for something more in-depth than that, but those are the things that come to mind when someone mentions the 'basics'.
Quote:Original post by Alpha_ProgDes
What are some basic concepts and/or maths a programmer should be familiar with before getting deep into XNA, D3D, or OGL?

I've scoured the internets, but I just don't want to be randomly learning (unnecessary) things.

Depends on how much your game you're going to be making on your own, what type of game you're making. (If you're going to be using things like Bullet, Ogre, Recast, Detour, Phsyx, etc then you're really not going to need much)

GameDev

If I was you I would dissect some of the samples that come with DirectX or XNA....The samples will quickly show you what you need to learn. Then go from there.

Might want to check out Unity and UDK too.
Things like WorldView, MapView, etc (well I think that's what they're called) are not necessary concepts to know? I see those terms (or something like them) from time to time.

Beginner in Game Development?  Read here. And read here.

 

Quote:Original post by Alpha_ProgDes
Things like WorldView, MapView, etc (well I think that's what they're called) are not necessary concepts to know? I see those terms (or something like them) from time to time.


Those terms can mean pretty much anything IMHO..

You need to understand spaces: "local space", "world space", "screen space", "whatever space" and the representation of spaces (coordinate system,"base vectors", matrix) and the transformation between them. You can see "local coordinates", "world coordinates", "screen coordinates", "whatever coordinates".

You can see "mapping" a space to another, that simply means transforming.
Transforming means the formulas, that can be used to calculate the coordinates in a space from another space. This transformation can be represented most of the times with matrix multiplication ("transformation matrix").

These are covered in vector/linear algebra. But as jyk said, linear algebra has a lot more stuff you don't really need.
Quote:Original post by Alpha_ProgDes
Things like WorldView, MapView, etc (well I think that's what they're called) are not necessary concepts to know?
As szecs alluded to, those terms don't really have any particular specific meaning in the context of 3-d math.

Different APIs use different terms; there are also terms that are commonly used in general, but there's also some aliasing involved (that is, multiple terms sometimes mean essentially the same thing).

I've never encountered the term MapView, although I suppose it could be something API-specific (Google seems to indicate there's a MapView class in the Android API). If I had to guess at the meaning of 'WorldView', I'd guess that it refers to the combined world and view transforms.

As noted previously, the important thing to understand here is coordinate spaces. Modern graphics pipelines take geometry through a number of different spaces, typically from local space, to world space, to view space, to clip space, etc. Any decent reference on the OpenGL or Direct3D pipeline will explain these spaces and how they work.

As I mentioned, there's some aliasing with respect to the terminology used. In particular, the following usually mean the same thing:

- local/model/object space
- view/camera space

This topic is closed to new replies.

Advertisement