1
我遇到了一个我认为可能与纹理坐标有关的问题,下面的图片显示了我正在渲染的瓷砖贴图 - 但是有时在瓷砖之间会出现间隙,如可在截图在下面的URL(屏幕下方有一个瓷砖之间的差距)。Android Open GL ES纹理问题
http://img15.imageshack.us/img15/4724/tileproblem.png
我的纹理区域被声明为
public class TextureRegion {
public final float u1, v1;
public final float u2, v2;
public final Texture texture;
public TextureRegion(Texture texture, float x, float y, float width, float height) {
this.u1 = x/texture.width;
this.v1 = y/texture.height;
this.u2 = this.u1 + width/texture.width;
this.v2 = this.v1 + height/texture.height;
this.texture = texture;
}
}
瓷砖纹理来自于一本地图册,并有32×32像素,我使用GL_NEAREST
是新的Open GL,我做不太明白我需要改变什么。纹理制作的
例
tile = new TextureRegion(items, 192,160,34,34);
干杯
斯图尔特
相信这是一个TEX COORDS问题?看起来更像一个几何图形。即使tex tex coords出了问题,背景也不会被看到。 –
感谢Stefan的回复,我想我同意你的观点,我目前正在重新审视我的多边形生成代码 – user1405313