GLSL extracting modelmatrix from modelviewmatrix and viewmatrix

瘦欲@ 提交于 2019-12-12 19:39:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!