void main()
{
…
glTranslatef(…);
glRotatef(…);
…//do some other change but can’t get the matrix(such as glGetFloatv(GL_MODELVIEW_MATRIX, matrix))here!
glCallList(i);
}
//The displayList’s position will changed at any time.how can we get the position of the object inserted in the list?
a) This not advanced question.
b) You posted the same questions on GameDev
c) Don’t post 3 questions in row like that
d) Learn to search for the anwsers
But if you have transformations inside the display list, you know that these transformations are static, so you always know what kind of transformations are done to the object inside the display list before the object is drawn. So get the matrix before callig the display list and multiply this by matrix by the matrix formed by all transformations in side the display lists, and you will get the matrix at the point you draw the object.