Advertisement

for a newbie what is matrix?

Started by February 15, 2002 07:04 PM
4 comments, last by dukenukem 23 years ago
i''ll be very happy if someone could tell about these? matrix glPushMatrix(); glPopMatrix(); glMatrixMode(Proj. or modelview or others i dont know); glLoadIdentity(); <<--- especially this one. .thanks.
glPush = pushes the matrix onto the stack. you maight need to store your current matrix, to do some other stuff and then...

glPop = ..it back again. (Push = "stack" ontop of stack; Pop = "take the item from very top of stack").

glLoadIdentity = Loads the identity matrix, wich is basiclly 0 or reset. 0,0,0...

the ident matrix look like this.

x y z 1
x 1 0 0 0
y 0 1 0 0
z 0 0 1 0
1 0 0 0 1

Get a book on linear algebra / linear vector math. Thoose usually explains matrix maths. Matrix math is a little wierd at first, especially multiplication of matrices, but basiclly (two matrices A and B wich are of n*q type) you mulitply all rows of A with all columns of B.

Edited by - ekas78 on February 15, 2002 9:07:48 PM
______________________________Only dead fish go with the main-stream.
Advertisement
A matrix is basically a certain number of rows and columns of numbers. They can be used for scaling, rotating, and transforming pints in 3D space. glLoadIdentity tells OpenGL that you want to reset everything to normal (no scale changes or rotations etc.). Then when you call glTranslate or glRotate it updates the matrix so that every vertex you set after that is multiplied by the matrix. The result is that each vertex is translated or rotated by your desired amount. You really do need to find a math book and read up on matrices.
-------------------------------------------------------BZZZZTT - CRASH - BANG"What was that?!""Captain, it appears that we have encountered a strange sub-space anomaly. I'm getting a high reading of tracheons beams. The anomaly seems to be some kind of rift in the space-time continuum. -- Never mind, Bones was just using the microwave again."
DDSquad: Why whould you wanna transform & scale pints at all?! (I mean, except from the kegg to my mouth & Maybe into 2 or 3 more pints... :-) )

(Ok, so it's just a typo, but it's late & i'm tired)...

/Ekas


Edited by - ekas78 on February 15, 2002 11:15:53 PM
______________________________Only dead fish go with the main-stream.
Unfortunately no one can be told what the matrix is. You have to see it for yourself.
Yepp, there''s a disclaimer coming with most books covering vector/matrix math. You know the type -"if you brake the seal and eat the red pill jada-jada...".

______________________________Only dead fish go with the main-stream.

This topic is closed to new replies.

Advertisement