[英]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.