在 OpenGL 中,如何读取模型 View 矩阵中的当前 x/y 转换?我知道您必须将当前矩阵加载到数组中并从那里读取 float ,但我不知 Prop 体该怎么做。
最佳答案
为了检索当前的模型 View 矩阵,您必须调用 glGetFloatv带有 GL_MODELVIEW_MATRIX
参数的函数。
GLfloat matrix[16];
glGetFloatv (GL_MODELVIEW_MATRIX, matrix);
来自文档:
GL_MODELVIEW_MATRIX
params returns sixteen values: the modelview matrix on the top of the modelview matrix stack. Initially this matrix is the identity matrix.
关于c++ - 获取当前的 ModelView 矩阵,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/766127/