Slick の Texture クラスを使用して、2 つの異なるテクスチャをキューブにバインドしたいと考えています。問題は、キューブにバインドした最初のテクスチャが正しく表示されることです。つまり、ピクセルごとに表示されますが、キューブの側面にバインドした他のテクスチャは、入力していないかのようにぼやけています。
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
これはキューブをレンダリングするコードです
public void render(){
float x = coordinate.x;
float y = coordinate.y;
float z = coordinate.z;
top.bind();
glBegin(GL_QUADS);
//TOP
glNormal3f(0f, 1f, 0f);
glTexCoord2f(0f, 0f);
glVertex3f(x,y,z);
glTexCoord2f(0f, 1f);
glVertex3f(x, y, z+1);
glTexCoord2f(1f, 1f);
glVertex3f(x+1, y, z+1);
glTexCoord2f(1f, 0f);
glVertex3f(x+1, y, z);
glEnd();
bottom.bind();
glBegin(GL_QUADS);
//BOTTOM
glNormal3f(0f, -1f, 0f);
glTexCoord2f(0f, 0f);
glVertex3f(x,y-1,z);
glTexCoord2f(0f, 1f);
glVertex3f(x, y-1, z+1);
glTexCoord2f(1f, 1f);
glVertex3f(x+1, y-1, z+1);
glTexCoord2f(1f, 0f);
glVertex3f(x+1, y-1, z);
glEnd();
sides.bind();
glBegin(GL_QUADS);
//BACK
glNormal3f(0,0,-1);
glTexCoord2f(0f, 0f);
glVertex3f(x,y,z);
glTexCoord2f(1f, 0f);
glVertex3f(x+1, y, z);
glTexCoord2f(1f, 1f);
glVertex3f(x+1, y-1, z);
glTexCoord2f(0f, 1f);
glVertex3f(x, y-1, z);
//FRONT
glNormal3f(0,0,1);
glTexCoord2f(0f, 0f);
glVertex3f(x,y,z+1);
glTexCoord2f(1f, 0f);
glVertex3f(x+1, y, z+1);
glTexCoord2f(1f, 1f);
glVertex3f(x+1, y-1, z+1);
glTexCoord2f(0f, 1f);
glVertex3f(x, y-1, z+1);
//LEFT
glNormal3f(-1,0,0);
glTexCoord2f(0f, 0f);
glVertex3f(x,y,z);
glTexCoord2f(0f, 1f);
glVertex3f(x, y-1, z);
glTexCoord2f(1f, 1f);
glVertex3f(x, y-1, z+1);
glTexCoord2f(1f, 0f);
glVertex3f(x, y, z+1);
//RIGHT
glNormal3f(1,0,0);
glTexCoord2f(0f, 0f);
glVertex3f(x+1,y,z);
glTexCoord2f(0f, 1f);
glVertex3f(x+1, y-1, z);
glTexCoord2f(1f, 1f);
glVertex3f(x+1, y-1, z+1);
glTexCoord2f(1f, 0f);
glVertex3f(x+1, y, z+1);
glEnd();
}