Public Group

# What exactly is a matrix?

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

## Recommended Posts

I am currently using the OpenGL and OpenSceneGraph API's to do some uni work and although i am still just learn the basics such as composing primitives, GL states and lighting there has been something bugging me for a while now. When i have to rotate or translate objects the documentation that i am using always refers to the matrix, I hate to sound stupid but what actually is a, or the matrix? So, for people who actually have an understanding of computer graphics, how would you define what the matrix actually is? Thanks for any input and apologies if my question is confusing :-)

##### Share on other sites
http://en.wikipedia.org/wiki/Matrix_(mathematics)

##### Share on other sites
While a definite answer to your question could fill one thousand textbooks, this might help to get you started:

http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html

What you really want to look up is an introduction to "Linear Algebra", this entire field of mathematics is devoted to study of matrices.

##### Share on other sites
Nobody can be told what matrix is....

PS: Sorry

##### Share on other sites
It's like a Sudoku.

##### Share on other sites
Symbolically, a matrix is just a way to hold the coefficients of a solution of m equations involving n unknowns (m x n matrix).

However, in linear algebra, we can also define a matrix to be a list of n vectors in R^n space.

Ex:
[ 1 2 3 ]
[ 3 1 7 ]
[ 2 9 6 ]

Can be understood as the coefficient matrix of a system of equations or as the three vectors, a1, a2, and a3, where a1 is the first column, a2 the second, and a3 the third.

There are a number of operations we can do with matrices, but these only make sense if you understand that as a system of vectors, a matrix is a transformation of the vector you are multiplying from R^n space to R^m space.

In graphics programming, we typically use a 4 x 4 matrix, which means when we multiply an R^4 vector by a matrix, a transformation occurs, producing a vector also in R^4 space.

Ex: A(m x n matrix) * b(R^n vector) = c(R^m vector)

If you consider matrices transformations, then we can describe the multiplication of matrices as the composition of transformations, just like when we compose functions. And just like the composition of functions, order matters.

Ex: g(f(x)) != f(g(x))
AB != BA (generally)

In graphics programming matrices are primarily used as transformations (or functions) that take a vector and produce a vector. By multiplying (composing) matrices, we can reduce the number of multiplications each vector needs.

For a more complete definition, Google is your friend, but a text would be better. I purchased a text on linear algebra at Half Price Book Store for \$4.99 (no joke) for my class this semester.

##### Share on other sites
Quote:
 Original post by AntheusNobody can be told what matrix is....

My thoughts exactly [grin]

To maintain some semblance of useful posting, I personally found this math primer a nice accessible starting point on what vertices and matrices are and how they work.

##### Share on other sites
Quote:
 Original post by karwostsWhat you really want to look up is an introduction to "Linear Algebra", this entire field of mathematics is devoted to study of matrices.

Linear Algebra also encompasses systems of linear equations, et al. Matrices are, as far as my understanding goes, just a helpful data structure/notation.

Unless I'm totally studying the wrong thing in preparation for my mathematics units at uni. >_>

##### Share on other sites
Quote:
 Original post by FenrisulvurLinear Algebra also encompasses systems of linear equations, et al. Matrices are, as far as my understanding goes, just a helpful data structure/notation.Unless I'm totally studying the wrong thing in preparation for my mathematics units at uni. >_>

No worries, at least my uni course back in the day started with systems of linear equations after the preliminaries. Later on it tapered off into vagueness with vector spaces, which is the part heavily used in computer graphics.

For an accurate treatise check out the link above, but the basic idea is that a matrix can transform vectors from one vector space to another. So you can use a matrix to stick your model vertices in a coordinate system that is for example translated or rotated wrt the base coordinate system (typically called world space).

##### Share on other sites
It's just a grid, that's all it means. It has many complex uses but it's literally just a grid of numbers, 2 dimensional (width and height).

• 18
• 11
• 16
• 9
• 49
• ### Forum Statistics

• Total Topics
631395
• Total Posts
2999781
×