Math is not my forte. Would somebody mind explaining matrices?

Started by
11 comments, last by Leonidus 19 years, 11 months ago
I''ve been going through various demos, I''ve searched through articles and forum posts, but I''m still a bit at a loss. (I found a post that asked, "why uses matrices?", only to find it went on to ask why they didn''t use an even more advanced concept even further beyond my limited means.) As a bit of background, I''ve got a college-graduated level of education in everything but math. Math is my one downfall, and while I can understand most of the concepts as they''re explained to me, I don''t really have the understanding of the terminology or the lettering used. I''m art-focused, I already work as an artist, but I want to know how the other half works, so that I can put into effect my own game designs, start to finish. I''ve done 2D programming, but I kept running into limitations which are easier to fix in 3D. I''m currently taking an OpenGL class, but the third chapter of the book goes into this stuff, and I''m at a loss. I''ve seen identity matrices, and I *somewhat* understand the concept, but I don''t understand the reasoning behind it, at least I haven''t seen anything explaining the reasoning. I''ve seen that the bottom row contains the direct positioning, relative to the origin point. What about the other three rows? And what''s the point of the 1''s down the middle? I understand that that''s what defines an identity matrix (I''ve seen about a dozen different articles and books define that, with no other explaination), but I don''t understand why they are what they are. It partially doesn''t help that my c++ knowledge, for understanding examples given here and elsewhere, is extremely limited, mostly to what I''ve learned inside Java, with a few of the differences in comparison. (Pointers are my friend.) So, can anyone help the poor lost art-guy?
Advertisement
An identity matrix is just a matrix that when multiplied by another matrix, will always equal the other matrix.
It''s like muliplying a number by one.
That''s because mutiplying two square matrices is just a process of doing dot products between the columns of the right matrix with the rows of the left matrix.
Perhaps learning how to write your own Matrix class is the way to go. You''ll understand what''s happnening. Heck, I should too.

--
You''re Welcome,
Rick Wong
- Google | Google for GameDev.net
quote:Original post by gtdelarosa
An identity matrix is just a matrix that when multiplied by another matrix, will always equal the other matrix.
It''s like muliplying a number by one.
That''s because mutiplying two square matrices is just a process of doing dot products between the columns of the right matrix with the rows of the left matrix.


And you''ve already lost me. What''s the process behind multiplying matrices?

And what''s a dot product? as I said, I have very little experience in math. I understand sin()/cos(), and a²+b²==c², at least in application, but that''s about the extend of my geometry.

A matrix class? Okay. And what exactly does a matrix class need that I would need to write one to understand it? I''m still working through the basics here.
http://www.martinb.com/maths/algebra/matrix/index.htm

Do google searches for linear algebra, I really doubt you'll find someone who can explain linear algebra in one web forum post... I dont think it is possible... there is a reason that linear algebra is an entire semester course in most computer science undergrad programs


[edited by - duke on May 19, 2004 6:23:31 PM]
super genius
Try to get a good book on linear algebra. A matrix is best understood as what it is instead of a magical block of numbers; it''s the representation of a linear transformation. At least, think of it as a function. And once you understand the mathematical concepts, you can do a lot more without having to do guesswork. Maybe ask someone in a math program for what book they use, if you don''t find a good book on Amazon.

Quote: "I really doubt you'll find someone who can explain linear algebra in one web forum post..."

What the heck, I've got nothing better to do

IMO, mathematicians and graphics programmers look to matricies to solve two different types of problems. A matrix, as it applies to the graphics programmer, represents a transformation from one coordinate system to another coordinate system. This matrix can have a different position, orientation, and scale independant of the original coordinate system. When you multiply an object by a matrix (using a dot product), you are transforming that object into a new coordinate space, possibly moving the object, rotating the object, and scaling the object in one operation. For example, suppose you had a matrix that represented a coordinate system that was five feet to your right and was flipped upside down. If you were to multiply an object by this matrix, the object would move five feet right of its previous location, and flip upside down. Matrices can also be multiplied by other matrices, which yields a matrix capable of performing many transformations in one operation. Suppose I had matrix A which moved an object 5 feet to the right, and matrix B which flipped an object upside down. I *could* multiply the object by matrix A to move it, and then multiply the object by matrix B to flip it. However, the best way would be to multiply matrix A by matrix B, creating matrix C which would be capable of moving AND fliping, and then multiply the object by matrix C. Using the product of the two matrices is preferable in a situation where you have more than one object, because this will result in fewer multiplications. In implementation, a matrix to perform two dimensional transformations is just a 3 x 3 grid of floating-point numbers.

Ex: 3x3 Identity matrix

[ [ 1, 0, 0 ],
[ 0, 1, 0 ],
[ 0, 0, 1 ] ]

A matrix to perform three dimensional transformations is a 4 x 4 grid of floating-point numbers. I hope this helps somewhat...


[edited by - EvilSteve on May 19, 2004 7:06:05 PM]
quote:Original post by duke
http://www.martinb.com/maths/algebra/matrix/index.htm

Do google searches for linear algebra, I really doubt you'll find someone who can explain linear algebra in one web forum post... I dont think it is possible... there is a reason that linear algebra is an entire semester course in most computer science undergrad programs


[edited by - duke on May 19, 2004 6:23:31 PM]


Oh, oh! I found what I needed. Off of that link, there's a tutorial which demonstrates a 3D model being manipulated through alterations to the itentity matrix. Adding to or changing each number simply alters the other corresponding dimensions of the model. They also include an exploratory program.

(Edit: Nevermind. The program is rather buggy and I can't make heads or tails of it from the documents it's referenced in.)

Still, the other post gets the idea down.

[edited by - Leonidus on May 19, 2004 7:22:44 PM]
quote:Original post by EvilSteve

Quote: "I really doubt you''ll find someone who can explain linear algebra in one web forum post..."

What the heck, I''ve got nothing better to do

(clipped for space)

A matrix to perform three dimensional transformations is a 4 x 4 grid of floating-point numbers. I hope this helps somewhat...


[edited by - EvilSteve on May 19, 2004 7:06:05 PM]


Ah, yes, that helps a great deal. I''m used to dealing in 3 dimensions, I''m a game artist, including 3d game meshes, so most of this stuff is familiar to me through various numeric tools in the modeller I use. I just need to learn how to associate my previous knowledge with this new application.

There, that wasn''t so hard, now, was it?
quote:Original post by Leonidus
quote:Original post by EvilSteve

Quote: "I really doubt you'll find someone who can explain linear algebra in one web forum post..."

What the heck, I've got nothing better to do

(clipped for space)

A matrix to perform three dimensional transformations is a 4 x 4 grid of floating-point numbers. I hope this helps somewhat...


[edited by - EvilSteve on May 19, 2004 7:06:05 PM]


Ah, yes, that helps a great deal. I'm used to dealing in 3 dimensions, I'm a game artist, including 3d game meshes, so most of this stuff is familiar to me through various numeric tools in the modeller I use. I just need to learn how to associate my previous knowledge with this new application.

There, that wasn't so hard, now, was it?


Jeez, I don't think anyone who has to deal with 3d everyday would forget something as simple and as frequently used as this, I don't think you are serious or you got up on the wrong side of the bed today . |suspicious| Are you sure you are
quote: 3 dimensions, I'm a game artist, including 3d game meshes
|/suspicious|

[edited by - snyp on May 19, 2004 7:31:36 PM]
Actual Linux penguins were harmed in the making of this message.

This topic is closed to new replies.

Advertisement