I’m trying to get the object coordinates of objects I’m drawing in 3D space.
I’ve read that the GL_MODELVIEW_MATRIX is the comprised of the GL_PROJECTION_MATRIX and the transformation_matrix(which isn’t defined for lwjgl).
So, are the object coordinates simply in the matrix:
transformation_matrix = GL_PROJECTION_MATRIX * inverse(GL_MODELVIEW_MATRIX);
Also…
If I’m letting the user move the camera around freely in the 3D space, do I have to add anything to the computation when I’m solving for the transformation_matrix?
I’ve already read that this ISN’T the way it should be done, and that I should be keeping track of any x,y and z coordinates myself. (As this isn’t what OpenGL was meant for)
In that case, what method would I use to keep track of x,y and z coordinates if I’m consistently doing something similar to:
glTranslatef(x, y, z);
glRotatef(degree, 0, 1, 0); //Where there could, or could NOT be a rotation
glRotatef(degree, 1, 0, 0);//Where there could, or could NOT be a rotation
glTranslatef(x, y, z);
…
etc.