Is there a way to get the r开发者_C百科otation matrix which is generated by command glRotatef()
in opengl?
No, but you can get the current matrix with glGetFloatv
. If you want just the rotation matrix, I think you should compute it yourself.
float modelViewMatrix[16];
glGetFloatv(GL_MODELVIEW_MATRIX, modelViewMatrix);
Note: the model view matrix must be initialized to the identity matrix before calls to rotate etc.
精彩评论