A few quick math questions

Started by
13 comments, last by taby 11 years, 10 months ago
I refer you to this blog post I found that explains all the concepts above in plain English with game-related examples. Sounds like it's exactly what you're looking for: http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-2/

Hope it helps!
Advertisement

Normalization - Takes the 2 vectors and gives it a magnitude of 1. Same direction, different length.


Normalization - takes one vector, returns another vector with same direction, but length / magnitude of 1.

Dot product is actually used almost everywhere. For example, a simple lighting model would calculate the dot product between surface normal and light direction to get the light intensity at each fragment or vertex. If the surface normal and light directions aren't normalized vectors, the light intensity will be wrong (ie. scaled by the length of the normals).


D3DXVec3TransformCoord requires a little understanding of vectors and matrices. A vector may define many things, including a position in some space (for example local/object or world space).

- for example, if you model a 3D object, you'd typically create it around origo. In order to place this object else where than in origo in your game engine, you'll need a translation matrix which may be used to transform the object to a different location. Practically, a translation matrix contains a offset vector which tells how much the mesh has to be moved in certain direction. The matrix may contain also rotations so that the object may be rotated to different directions.

So a matrix can be used to transform a position from one space to another.

In computer graphics, typically you'll have several spaces such as :

- local space. Each object is defined in local space
- world space. Each object has a transform matrix which is used to transform from local space to world space.
- view space. Your camera has a camera matrix, which is used to transform position from world space to view space.
- projection/clip space. Your camera has a projection matrix which is used to transform a position from view space to projection space

And to mess things up a bit more, vector matrix multiply is practically few dot products.


Best regards!

I refer you to this blog post I found that explains all the concepts above in plain English with game-related examples. Sounds like it's exactly what you're looking for: http://blog.wolfire....elopers-part-2/

Hope it helps!


That's awesome! I saved it for future reference ;) Thank you!
The majority of Internet Explorer users don't understand the concept of a browsing application, or that there are options.
They just see the big blue 'e' and think "Internet". The thought process usually does not get much deeper than that.

Worms are the weirdest and nicest creatures, and will one day prove themselves to the world.

I love the word Clicky

[quote name='littletray26' timestamp='1338537052' post='4945238']
Normalization - Takes the 2 vectors and gives it a magnitude of 1. Same direction, different length.


Normalization - takes one vector, returns another vector with same direction, but length / magnitude of 1.

Dot product is actually used almost everywhere. For example, a simple lighting model would calculate the dot product between surface normal and light direction to get the light intensity at each fragment or vertex. If the surface normal and light directions aren't normalized vectors, the light intensity will be wrong (ie. scaled by the length of the normals).


D3DXVec3TransformCoord requires a little understanding of vectors and matrices. A vector may define many things, including a position in some space (for example local/object or world space).

- for example, if you model a 3D object, you'd typically create it around origo. In order to place this object else where than in origo in your game engine, you'll need a translation matrix which may be used to transform the object to a different location. Practically, a translation matrix contains a offset vector which tells how much the mesh has to be moved in certain direction. The matrix may contain also rotations so that the object may be rotated to different directions.

So a matrix can be used to transform a position from one space to another.

In computer graphics, typically you'll have several spaces such as :

- local space. Each object is defined in local space
- world space. Each object has a transform matrix which is used to transform from local space to world space.
- view space. Your camera has a camera matrix, which is used to transform position from world space to view space.
- projection/clip space. Your camera has a projection matrix which is used to transform a position from view space to projection space

And to mess things up a bit more, vector matrix multiply is practically few dot products.


Best regards!
[/quote]

Thank you for that lesson in math ;) :)
The majority of Internet Explorer users don't understand the concept of a browsing application, or that there are options.
They just see the big blue 'e' and think "Internet". The thought process usually does not get much deeper than that.

Worms are the weirdest and nicest creatures, and will one day prove themselves to the world.

I love the word Clicky
The dot product is very intuitive especially when you use two unit length (... normalized... magnitude of 1) vectors for the input. If the vectors are pointing in the same direction, then the dot product is 1. If they are orthogonal (at right angle) then dot prod is 0. If they are pointing in opposite direction the dot prod is -1.

Now, if you go ahead and plot arccos (see http://www.wolframal...os from 1 to -1), you will see that the dot prod of two unit vectors fed into acos gives you the angle between the vectors in radians. That is, acos(1) is 0, acos(0) is pi/2 and acos(-1) is pi.

Of course 0 radians is 0 degrees, pi/2 radians is 90 degrees, and pi radians is 180 degrees.

Dot prod is used for lighting calculations, and friction between two surfaces, and backface culling, and all kinds of other things. Try experimenting with non-unit vectors to see how it affects the dot product. Fun times.

I see that the link given above has a similar explanation. :) Oh well.

This topic is closed to new replies.

Advertisement