lbonafide

08-28-2001, 04:31 PM

Can somebody tell me what the numbers in the transformation matrices actually represent? This is a system of linear equations, right? What are the equations?

Thanks...

Lloyd Bonafide

Thanks...

Lloyd Bonafide

View Full Version : What do the numbers in the matrix mean?

lbonafide

08-28-2001, 04:31 PM

Can somebody tell me what the numbers in the transformation matrices actually represent? This is a system of linear equations, right? What are the equations?

Thanks...

Lloyd Bonafide

Thanks...

Lloyd Bonafide

Paulus

08-28-2001, 06:49 PM

Well my friend -it's not exactly a system of linear equations because the matrix is not multiplied with a vector (a matrix column);the matrix is multiplied with another 4x4 matrix.In general the elements of the main diagonal (1,1) (2,2) (3,3) have to do with the scale part of the matrix in x,y and z directions.The elements (1,4),(2,4) and (3,4) with the transformation part and all the other elements (except the fourth row which does not contain info-all elements are zero except the last which is 1) with the rotation stuff (in combination with the elements of the diagonal).

john

08-28-2001, 06:51 PM

er, well, if you have a matrix * vector:

[x'] = [ A B ] * [ x ]

[y'] = [ C D ] * [ y ]

then this forms two linear equations:

x'=Ax + By

y'=Cx + Dy

the matrix represents the coefficients of the linear equations.

cheers,

John

[This message has been edited by john (edited 08-28-2001).]

[x'] = [ A B ] * [ x ]

[y'] = [ C D ] * [ y ]

then this forms two linear equations:

x'=Ax + By

y'=Cx + Dy

the matrix represents the coefficients of the linear equations.

cheers,

John

[This message has been edited by john (edited 08-28-2001).]

kabir

08-28-2001, 08:25 PM

Originally posted by lbonafide:

Can somebody tell me what the numbers in the transformation matrices actually represent? This is a system of linear equations, right? What are the equations?

If you _really_ want to know exactly what's going on, I highly recommend reading Computer Graphics : Principles and Practice, Second Edition in C. (Available at Amazon: http://www.amazon.com/exec/obidos/ASIN/0201848406 )

It's not specifically about OpenGL, but it explains (in great detail) how to build a rendering engine. It starts with a discussion of rasterizing lines and goes from there. Not exactly a light read, but you'll really know what's happening by the time you're done.

I'm going though it now (I've had it for years, but this is the first full read through) and I can't say enough good things about it...

Hope this helps http://www.opengl.org/discussion_boards/ubb/wink.gif

Can somebody tell me what the numbers in the transformation matrices actually represent? This is a system of linear equations, right? What are the equations?

If you _really_ want to know exactly what's going on, I highly recommend reading Computer Graphics : Principles and Practice, Second Edition in C. (Available at Amazon: http://www.amazon.com/exec/obidos/ASIN/0201848406 )

It's not specifically about OpenGL, but it explains (in great detail) how to build a rendering engine. It starts with a discussion of rasterizing lines and goes from there. Not exactly a light read, but you'll really know what's happening by the time you're done.

I'm going though it now (I've had it for years, but this is the first full read through) and I can't say enough good things about it...

Hope this helps http://www.opengl.org/discussion_boards/ubb/wink.gif

evil

08-28-2001, 10:51 PM

The top-left 3x3 numbers are the rotation part. They're actually 3 vectors, telling you which way up, left, and back (or the other way http://www.opengl.org/discussion_boards/ubb/smile.gif are facing. They should be of length 1. Other lengths give make your object larger or smaller.

The top 3 numbers on the right are x y and z scale I believe.

The 3 bottom-left numbers are x y and z translation.

I may have mixed the last 2 rows up, can't check right now.

What the last number (bottom right) is for, I don't know. Don't know if it's even used, I certainly never used it http://www.opengl.org/discussion_boards/ubb/wink.gif

The top 3 numbers on the right are x y and z scale I believe.

The 3 bottom-left numbers are x y and z translation.

I may have mixed the last 2 rows up, can't check right now.

What the last number (bottom right) is for, I don't know. Don't know if it's even used, I certainly never used it http://www.opengl.org/discussion_boards/ubb/wink.gif

DaViper

08-28-2001, 11:20 PM

Check this link for further Information about the matrices: http://www.opengl.org/discussion_boards/cgi_directory/

Paulus

08-29-2001, 05:35 PM

Originally posted by john:

[B]er, well, if you have a matrix * vector:

[quote]

[x'] = [ A B ] * [ x ]

[y'] = [ C D ] * [ y ]

then this forms two linear equations:

x'=Ax + By

y'=Cx + Dy

the matrix represents the coefficients of the linear equations.

cheers,

John

If you examine a specific point then that's true John-although it's not quite like that because here x and y are known!If it were a linear system then x and y would be the unknown variables!

[B]er, well, if you have a matrix * vector:

[quote]

[x'] = [ A B ] * [ x ]

[y'] = [ C D ] * [ y ]

then this forms two linear equations:

x'=Ax + By

y'=Cx + Dy

the matrix represents the coefficients of the linear equations.

cheers,

John

If you examine a specific point then that's true John-although it's not quite like that because here x and y are known!If it were a linear system then x and y would be the unknown variables!

Bob

08-31-2001, 12:19 AM

A, B, C and D build the matrix, i.e. the coeficients in the equation system. x and y are two unknown variables building a 2D coordinate, can be any value you like, which are transformed by the matrix, i.e. the equation system, and results in a new 2D point represented by x' and y'.

So what do you mean by John examining a specific point? If x and y are know, can you tell me their values?

So what do you mean by John examining a specific point? If x and y are know, can you tell me their values?

nickels

08-31-2001, 10:12 AM

Your opengl matrix looks like (forget about homogeneous coordinates):

a b c

d e f

g h i

and, of course, your points looks like:

x

y

z

Now when the matrix "acts" on your point, what is meant is your point is multiplied by the matrix. The formula for this is:

a b c x (a*x + b*y + c*z)

d e f * y = (d*x + e*y + f*z)

g h i z (g*x + h*y + i*z)

So, for instance, pretend the matrix was:

2 0 0

0 2 0

0 0 2

Multiplying this matrix by your point gives:

(2*x + 0*y + 0*z) 2x

(0*x + 2*y + 0*z) = 2y

(0*x + 0*y + 0*z) 2z

In other words, it scales your point by 2.

Now I don't attempt to explain why, but to rotate around the z axis by an angle A, the matrix looks like:

cos(A) -sin(A) 0 x (cos(A)*x - sin(A)*y )

sin(A) cos(A) 0 * y = (sin(A)*x + cos(A)*y)

0 0 1 z z

Notice the z coord stays fixed, as it should for a rotation around z.

Many transformations are possible, but a matrix multiply is a "linear" operation, meaning it basically squishes and rotates your object. Translations can also be done with a matrix, but only one in a higher dimension that your vector space.

Blah blah blah...

a b c

d e f

g h i

and, of course, your points looks like:

x

y

z

Now when the matrix "acts" on your point, what is meant is your point is multiplied by the matrix. The formula for this is:

a b c x (a*x + b*y + c*z)

d e f * y = (d*x + e*y + f*z)

g h i z (g*x + h*y + i*z)

So, for instance, pretend the matrix was:

2 0 0

0 2 0

0 0 2

Multiplying this matrix by your point gives:

(2*x + 0*y + 0*z) 2x

(0*x + 2*y + 0*z) = 2y

(0*x + 0*y + 0*z) 2z

In other words, it scales your point by 2.

Now I don't attempt to explain why, but to rotate around the z axis by an angle A, the matrix looks like:

cos(A) -sin(A) 0 x (cos(A)*x - sin(A)*y )

sin(A) cos(A) 0 * y = (sin(A)*x + cos(A)*y)

0 0 1 z z

Notice the z coord stays fixed, as it should for a rotation around z.

Many transformations are possible, but a matrix multiply is a "linear" operation, meaning it basically squishes and rotates your object. Translations can also be done with a matrix, but only one in a higher dimension that your vector space.

Blah blah blah...

Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.