给一个长方形加上纹理

和OpenGL一样JOGL添加纹理时也有以下步骤:

  1. 创建纹理TextureIO.newTextureData(GLProfile.getDefault(), new File("FileName"), false, "图片格式");
  2. 设置滤波(和opengl一样

    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);  

     gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);

3.绑定纹理

Texture.bind(gl);

4.设置纹理坐标

JOGL纹理

 

 

转载于:https://my.oschina.net/marner/blog/785171

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-06-06
  • 2022-01-07
  • 2021-07-17
猜你喜欢
  • 2021-12-19
  • 2022-02-16
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案