Jump to content
  • Advertisement
Sign in to follow this  
Nicholas Kong

What type of programs can I work on to apply Linear Algebra concepts

This topic is 1620 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just finished my Linear Algebra final. It was very computation heavy like the previous exams but nothing that screams "this is impossible". First time taking Linear Algebra.

 

Now that I finished my studies. May anyone point me to what type of stimulation or games I can work on that uses a lot of the concepts from Linear Algebra?

 

Anyone of the games use a function that needs to find a determinant of a matrix or find the eigenvalues or eigenvectors of a given matrix or even use the Gram Schmidt process or needs to compute an inverse of a matrix or heck even use the P*P^-1?

 

I really want to start this journey given my background in Linear Algebra.

 

By the way does the application have to be in 3D? 

 

I have background programming simple 2D games so I want to apply linear algebra to 2D games if possible. If not, you can list 3D applications.  

Edited by warnexus

Share this post


Link to post
Share on other sites
Advertisement

Linear algebra is very useful for transforming coordinate systems...

 

in shaders you multiply 4d vectors representing vertex positions by a matrix to transform that vertex coordinates in to 2d screen space.. its called a projection matrix.. you can also use matrices to represent orientations/scalings/positions of an object in some coordinate system and use that matrix to transform other objects to the same coordinate system...

 

ie object1Pos = (x,y,z,w)

 

object1NewPos = object2TransformMatrix * object1Pos

 

This can be used just as well in 2d as it can in 3d - when you start using shaders in your rendering you will likely be using matrices a lot for transforming coordinate spaces

 

Also - the inverse matrix can be used to sort of go back... I used an inverse of the projection matrix to map 2d mouse movements to a 3d space

Share this post


Link to post
Share on other sites
I'm going to give you a brief review:
 
Transform Matrix = Coordinate System. Every Game Object has at least one.
 
Matrices have one objective (in practice): put vectors in another Coordinate System (a new scaled/rotated/translated system) etc.
Your Scene Node is made with a lot of vertices.
The origin of the Coordinate System of your Scene Node doesn't exist (actually exist, is the Identity Matrix, but you've didn't any transformation from the point that was created)
 
Matrices that I've used most so far:
 
Transform/Model/World Matrix (scale/rotate/translate my player)
View Matrix (put a Enemy to face the player given a eye position and a target position)
Projection (render something like a hologram)
 
Good Luck! I hope that you've understood a little (and my words too).

Share this post


Link to post
Share on other sites

Linear algebra is very useful for transforming coordinate systems...

 

in shaders you multiply 4d vectors representing vertex positions by a matrix to transform that vertex coordinates in to 2d screen space.. its called a projection matrix.. you can also use matrices to represent orientations/scalings/positions of an object in some coordinate system and use that matrix to transform other objects to the same coordinate system...

 

ie object1Pos = (x,y,z,w)

 

object1NewPos = object2TransformMatrix * object1Pos

 

This can be used just as well in 2d as it can in 3d - when you start using shaders in your rendering you will likely be using matrices a lot for transforming coordinate spaces

 

Also - the inverse matrix can be used to sort of go back... I used an inverse of the projection matrix to map 2d mouse movements to a 3d space

Ah shaders that means I need to learn OpenGL.

Share this post


Link to post
Share on other sites

 

I'm going to give you a brief review:
 
Transform Matrix = Coordinate System. Every Game Object has at least one.
 
Matrices have one objective (in practice): put vectors in another Coordinate System (a new scaled/rotated/translated system) etc.
Your Scene Node is made with a lot of vertices.
The origin of the Coordinate System of your Scene Node doesn't exist (actually exist, is the Identity Matrix, but you've didn't any transformation from the point that was created)
 
Matrices that I've used most so far:
 
Transform/Model/World Matrix (scale/rotate/translate my player)
View Matrix (put a Enemy to face the player given a eye position and a target position)
Projection (render something like a hologram)
 
Good Luck! I hope that you've understood a little (and my words too).

 

When you mean scale do you mean you are enlarging a 2D sprite or a 3D model to be of small or larger size than its normal size?

I understanding the rotate. You can change the angle of where the object is facing.

What I don't get is the translate. What do you mean by translate the player?

Edited by warnexus

Share this post


Link to post
Share on other sites

The machine learning, computer vision, data mining are field is full of linear algebra, and so Facebook, Google and Twitter are also full of linear algebra.

Share this post


Link to post
Share on other sites


What I don't get is the translate. What do you mean by translate the player?

 

 

it simply means moving the player to another position in relations to every other scene object, or simply the world... Think of it like a change of position

Share this post


Link to post
Share on other sites

 

 

I'm going to give you a brief review:
 
Transform Matrix = Coordinate System. Every Game Object has at least one.
 
Matrices have one objective (in practice): put vectors in another Coordinate System (a new scaled/rotated/translated system) etc.
Your Scene Node is made with a lot of vertices.
The origin of the Coordinate System of your Scene Node doesn't exist (actually exist, is the Identity Matrix, but you've didn't any transformation from the point that was created)
 
Matrices that I've used most so far:
 
Transform/Model/World Matrix (scale/rotate/translate my player)
View Matrix (put a Enemy to face the player given a eye position and a target position)
Projection (render something like a hologram)
 
Good Luck! I hope that you've understood a little (and my words too).

 

When you mean scale do you mean you are enlarging a 2D sprite or a 3D model to be of small or larger size than its normal size?

I understanding the rotate. You can change the angle of where the object is facing.

What I don't get is the translate. What do you mean by translate the player?

 

Well, I'm going to take a piece of code of my Software.

 

void Entity::Update(float dt) 
{
position += velocity * dt;

transform = Matrix44(); //reset to identity

//scale
transform.m11 = scale.x;
transform.m22 =  scale.y;
transform.m33 = scale.z;

//rotate
transform = transform * rotation;

//translate
transform.m41 = position.x;
transform.m42 = position.y;
transform.m43 = position.z;
}
Note that you could do a Scale, Rotation, a Translation Matrix and multiply all together Transform = (S * R * T) because one will transform another in the sequence.
But to be fast, we can reset the matrix, set the scale, multiply by the rotation (the currently is the scale) and set the translation. Note that the Matrices are in Row Major Order. 
 
If you want to understand the concepts you MUST write your own Algebra Library (Vector, Matrix).
After, you can play like a video-game. Put a camera position behind the player (multiplying a offset with the player's transform), make enemies face the player (View Matrix) or do orthographic projections like those clips that we see on Dead Space's cut scenes (Projection Matrix). 
3D Rotations are very different from the 2Ds because there are 3 axis. In 2D with one angle you can describe the player's rotation. In 3D you'll need the Euler Angles. I don't recommend to extract a rotation matrices from those angles. Instead, keep doing rotation changing when it's needed it and later extract the angles.
With a decent knowledge of matrices you can do everything like: writing a Graphics/Physics Engine, Collision Methods, etc.
 
So WORTH a lot to studying that.

Share this post


Link to post
Share on other sites

 

Linear algebra is very useful for transforming coordinate systems...

 

in shaders you multiply 4d vectors representing vertex positions by a matrix to transform that vertex coordinates in to 2d screen space.. its called a projection matrix.. you can also use matrices to represent orientations/scalings/positions of an object in some coordinate system and use that matrix to transform other objects to the same coordinate system...

 

ie object1Pos = (x,y,z,w)

 

object1NewPos = object2TransformMatrix * object1Pos

 

This can be used just as well in 2d as it can in 3d - when you start using shaders in your rendering you will likely be using matrices a lot for transforming coordinate spaces

 

Also - the inverse matrix can be used to sort of go back... I used an inverse of the projection matrix to map 2d mouse movements to a 3d space

Ah shaders that means I need to learn OpenGL.

 

Sure, unless you are specifically interested only in the math.

You can draw to a 2D screen using nothing but code, math and a good attitude. It won't be the most elegant or desirable solution, but so what?

There are many interesting things you can do once you are able to just get a window up and draw to it, such as drawing primitives and animating them using bones and constraints. It doesn't have to be very complicated.

 

Either way, if you really want to work with graphics, you'll want to learn OpenGL, which consists of this:

10% setting up

20% understanding how opengl renders to the screen (aka what is a rasterizer)

80% math

 

and yes, this adds up to 110% :D

Share this post


Link to post
Share on other sites

 



What I don't get is the translate. What do you mean by translate the player?

 

 

it simply means moving the player to another position in relations to every other scene object, or simply the world... Think of it like a change of position

 

Oh I get it now! Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!