I need a function that applies a translation like glTranslate()
to a point.
Does someone know of a function like glTranslate()
and glRotate()
to modify and retrieve a matrix to multiply?
OpenGL glTranslate and glRotate
1.4k Views Asked by ghiboz At
2
There are thousands of free matrix classes out there. Have a hunt round google and then you can set up a translation and rotation without using the gl* functions at all ...
edit: If you really just want to create the matrix without using a more than handy matrix class then you can define glRotatef( angle, x, y, z ) as follows:
As taken from wikipedia.
A translation matrix is really easy to create: glTranslatef( x, y, z) is define as follows:
You can look up matrix multiplication and matrix-vector multiplication pretty easily.
To make your life simple, though, you could just download a matrix class which does all this for you ...