[英]How to save the transform matrix in GLKit?
在iOS 5中,使用EAGLView,您可以:
glPushMatrix();
glTranslatef(x, y, 0.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glPopMatrix();
使用GLKView,是否被以下内容取代?
GLKMatrix4 t = self.effect.transform.modelviewMatrix;
self.effect.transform.modelviewMatrix = GLKMatrix4Translate(t, x, y, 0);
[self.effect prepareToDraw];
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
self.effect.transform.modelviewMatrix = t;
有点难看......
查看GLKMatrixStack 。 我用它在GLKit中构建分层模型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.