lacas
lacas

Reputation: 14077

Opengl ES sliding texture animation

I d like to animate a texture on a vertex from left to right. How can i do this?

my old code is:

        float texCoords[] = { 
            iTextcoord, 0.0f, 
            iTextcoord, 1.0f, 
            iTextcoord+1.0f, 0.0f, 
            iTextcoord+1.0f, 1.0f, 
        };
        this.setTextureCoords(texCoords);

but its isnt the best:(

Upvotes: 0

Views: 787

Answers (1)

genpfault
genpfault

Reputation: 52166

You can use glMatrixMode(GL_TEXTURE_MATRIX) and glTranslatef().

Upvotes: 2

Related Questions