Opengl ES滑动纹理动画
我想从左到右在顶点上创建纹理。 我怎样才能做到这一点?
我的旧代码是:
float texCoords[] = {
iTextcoord, 0.0f,
iTextcoord, 1.0f,
iTextcoord+1.0f, 0.0f,
iTextcoord+1.0f, 1.0f,
};
this.setTextureCoords(texCoords);
但它不是最好的:(
您可以使用glMatrixMode(GL_TEXTURE_MATRIX)
和glTranslatef()
。
上一篇: Opengl ES sliding texture animation
下一篇: OpenGL ES 3d rotation causes unintentional translation?