some things are complicated too much, somewhere used wrong names...
but anyway i have checked parsed data, everything is correct.
tested with simple object, result:
http://img7.imageshack.us/img7/5130/omgwtfqj.jpglooks like texture is applied on every side, instead of whole object.
here is my CTexture class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public class CTexture { private Texture texture; private boolean loaded; public CTexture() { loaded = false; } public void LoadTextureFromResource(String res,String type) throws IOException { InputStream stream = getClass().getResourceAsStream(res); TextureData data = TextureIO.newTextureData(GLProfile.getDefault(),stream, false, type); this.texture = TextureIO.newTexture(data); this.loaded = true; } public boolean hasTexture() { return loaded; } public void apply2Object(GL gl) { texture.enable(gl); texture.bind(gl); } } |