Sign in to follow this  

Superman[3 2 7 5] (Vector! Yes!) Needs Help

This topic is 1931 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

Can someone show me some applications for matrices in 2d graphics programming, or other facets of linear algebra being used in game programming. I just don't see where a lot of these topics are very useful yet?

Share this post


Link to post
Share on other sites
[quote name='superman3275' timestamp='1349306005' post='4986581']
Can someone show me some applications for matrices in 2d graphics programming, or other facets of linear algebra being used in game programming. I just don't see where a lot of these topics are very useful yet?
[/quote]
SFML uses [url="http://www.sfml-dev.org/documentation/2.0/classsf_1_1Transform.php"]matrices[/url] to position, rotate, and scale [url="http://www.sfml-dev.org/documentation/2.0/classsf_1_1Transformable.php"]sprites[/url]. This matrix is used when rendering the sprites to transform the vertices into the right positions.

Also, please choose better thread titles. You don't need to put your name in it saying you need help (that's pretty obvious by the fact that you're creating a thread). Rather, help people know what it is you're asking about (for example, title it something like "Applications for matrices in 2D graphics programming?").

Share this post


Link to post
Share on other sites
Sorry, I just felt kind of clever with that matrix (My name is a vector, get it! No, no, okay, I'm sorry). Yes, that makes sense, I'm using SFML though. If I was using SFML would there be a point in matrices or does SFML do all the matrix math for me.

Share this post


Link to post
Share on other sites
Ah, I see, I missed the joke :)

[quote name='superman3275' timestamp='1349307648' post='4986589']
Sorry, I just felt kind of clever with that matrix (My name is a vector, get it! No, no, okay, I'm sorry). Yes, that makes sense, I'm using SFML though. If I was using SFML would there be a point in matrices or does SFML do all the matrix math for me.
[/quote]
Depends on what you want to do. It'll generally do the matrix stuff for you (i.e. you can say move/rotate/scale by this much and it'll manipulate the matrix for you), but if you want to [url="http://en.wikipedia.org/wiki/Shear_matrix"]shear[/url] or [url="http://en.wikipedia.org/wiki/Transformation_matrix#Reflection"]reflect[/url] or apply other affine transformations, you need to know how to do it yourself, as SFML doesn't supply helper methods for doing these things.

You also need to understand how matrices work, at least, because when you [url="http://en.wikipedia.org/wiki/Concatenation_(mathematics)"]concatenate[/url] matrices (i.e. multiply them together into one matrix), order is important. You need to at least understand if you should rotate before translating, for example, and in which order to combine different matrices in order to get the right effect (or else you'll get it backwards).

You don't have to know a ton of linear algebra to use SFML or similar libraries that'll handle much of the matrix manipulating for you, but it certainly helps.

Share this post


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