Hi-
I have a texture image in a PPM file and all the u, v coordinates. I am tring to render the texture for the model. The Red Book isnt helping me too much. Any hel really appreciated
Thx
Hi-
I have a texture image in a PPM file and all the u, v coordinates. I am tring to render the texture for the model. The Red Book isnt helping me too much. Any hel really appreciated
Thx
Use an other textureLoader, not the AWT loader. I never used PPM’s but I think this code should work
protected int texName[]={0};
// reads the image, call this function in you init() method.
public void init_texture()
{
// read PPM’s
TextureLoader texLoader = new PPMAsciiTextureLoader(gl,glu);
texLoader.readTexture("yourimage.ppm");
gl.glPixelStorei(GL_UNPACK_ALIGNMENT,1);
// Generate texture names (id's)
gl.glGenTextures(1,texName);
gl.glBindTexture(GL_TEXTURE_2D,texName[0]);
gl.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
gl.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
gl.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl.glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
texLoader.texImage2DNonScaled(true);
}