问题
since in GLSL the modelmatrix is not available, i was wondering if it is possible to get it programatically from the gl_ModelViewMatrix and the "viewmatrix" which i would pass as a uniform?
if yes, how?
thank you!
回答1:
You can obtain the model matrix by multiplying the modelview matrix with the inverse of your view matrix.
gl_ModelViewMatrix * myViewMatrixInverse
来源:https://stackoverflow.com/questions/1147280/glsl-extracting-modelmatrix-from-modelviewmatrix-and-viewmatrix