It’s OpenGL and the texture should be zig zagging.
I have the effect working, it’s just not very efficient:
float difY = tile.top() - tile.bottom();
int offZ = off % 360;
float o_ = 0;
for (int z = offZ; z <= 360 + offZ; ) {
float x_ = (float) (Math.sin(z * DEG_2_RAD) * 2 * PIXEL_X);
gl.glTexCoord2f(tile.left(), tile.bottom() + difY * (z - offZ) / 360);
gl.glVertex2f(l + o_, b + h_interval * (z - offZ) / 360); // bottom-left
gl.glTexCoord2f(tile.right(), tile.bottom() + difY * (z - offZ) / 360);
gl.glVertex2f(r + o_, b + h_interval * (z - offZ) / 360); // bottom-right
z += 30;
o_ = x_;
gl.glTexCoord2f(tile.right(), tile.bottom() + difY * (z - offZ) / 360);
gl.glVertex2f(r + x_, b + h_interval * (z - offZ) / 360); // top-right
gl.glTexCoord2f(tile.left(), tile.bottom() + difY * (z - offZ) / 360);
gl.glVertex2f(l + x_, b + h_interval * (z - offZ) / 360); // top-left
}
(h_interval is the height of a tile, l is the left x coordinate of a tile, r is the right x coordinate of a tile, b is the bottom y coordinate of a tile, offZ is just a number i’m incrementing after each render, to make the effect move)
I’m trying to get a ‘mirage’ effect (tiles waving back and forth using sine. also i’m sure there’s a way better way of doing this, if you know of it point it out)
edit: how do I get the smallest number of triangles (not reuse vertices) is my question I guess, in response to your edit