Could somebody please explain to me how does the transformation matrix work? How i work on the transformation matrix if i do not use the glTranlsatef command
computeMatrix();// I'm not really undestand what is going on in the multiply matrix
12-14-2003, 10:10 PM
It is a bit messy to explain, but there are tons of tutorials on matrices out there, use google, it works the same way in OpenGL (the red book is also available for download and has lots of information about this), you could also have a peek on this website and the faq.
You can use glLoadMatrix to setup the matrices any way you want and you can use glMultMatrix to multiply one matrix with the existing one.
To put it very short, a matrix contains the result of all glTranslate/glScale/glRotate that you have done, so if you have called glTranslatef( 1,0,0), then the current matrix holds the information required to do this, if you then create a matrix that contains the result equal to glTranslate(2,0,0) and use glMultMatrix to multiply this matrix with the current one, then the current matrix will hold the result equal to glTranslate( 3,0,0).
So you can look at a matrix as a storage area for all the combined transformations that you have done, the neat thing here is that once you have this matrix you can multiply any vector with it and the vector will be transformed just as if you would have called all the glTranslate/glkScale/glRotate but in onw single operation.
This is oversimplified, it is just one use of matrices and it lacks a lot of information, so as I said, poke around google to find some matrix tutorials, there are lots of them.
Try my maths3D DLL. It handles rotation, positioning, and transforming points from one space to another.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.