我有GL.GL_QUAD_STRIP
一个纹理,因为GL.GL_QUAD_STRIP
尺寸比纹理图像尺寸大得多,这个图像变得拉伸和模糊,所以我想也许有一种方法可以将这个纹理设置为“切片”模式,使其更清晰锐利.
编辑: “切片”我的意思是在图像结束的位置,我将再次开始绘制,除了出现一点点硬拉伸。
这就是我到目前为止所拥有的 -
double m_x , m_y , m_z ;
Texture m_cubeSides ;
public void display(GLAutoDrawable gLDrawable)
{
final GL gl = gLDrawable.getGL();
gl.glTexParameteri ( GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_LINEAR_MIPMAP_LINEAR);
gl.glTexParameteri( GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_LINEAR_MIPMAP_LINEAR);
m_cubeSides.bind();
gl.glBegin(GL.GL_QUAD_STRIP);
// Quad 1
gl.glTexCoord2f(1.0f, 0.0f);
gl.glVertex3d(m_x, m_y, 0);
gl.glTexCoord2f(1.0f, 1.0f);
gl.glVertex3d(m_x, 0, 0);
gl.glTexCoord2f(0.0f, 0.0f);
gl.glVertex3d(0, m_y, 0);
gl.glTexCoord2f(0.0f, 1.0f);
gl.glVertex3d(0, 0, 0);
// Quad 2 - front
gl.glTexCoord2f(1.0f, 0.0f);
gl.glVertex3d(0, m_y, m_z);
gl.glTexCoord2f(1.0f, 1.0f);
gl.glVertex3d(0, 0, m_z);
gl.glTexCoord2f(0.0f, 0.0f);
gl.glVertex3d(m_x, m_y, m_z);
gl.glTexCoord2f(0.0f, 1.0f);
gl.glVertex3d(m_x, 0, m_z);
// Quad 3 - east side
gl.glTexCoord2f(1.0f, 0.0f);
gl.glVertex3d(m_x, m_y, m_z);
gl.glTexCoord2f(1.0f, 1.0f);
gl.glVertex3d(m_x, 0, m_z);
gl.glTexCoord2f(0.0f, 0.0f);
gl.glVertex3d(m_x, m_y, 0);
gl.glTexCoord2f(0.0f, 1.0f);
gl.glVertex3d(m_x, 0, 0);
// Quad 4 - west side
gl.glTexCoord2f(1.0f, 0.0f);
gl.glVertex3d(0, m_y, 0);
gl.glTexCoord2f(1.0f, 1.0f);
gl.glVertex3d(0, 0, 0);
gl.glTexCoord2f(0.0f, 0.0f);
gl.glVertex3d(0, m_y, m_z);
gl.glTexCoord2f(0.0f, 1.0f);
gl.glVertex3d(0, 0, m_z);
gl.glEnd();
}