开发者

Obatining Rotation Matrix from glRotatef() in opengl

开发者 https://www.devze.com 2023-03-29 06:02 出处:网络
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,

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消