Hi everybody!
I'm loading my OBJ object and it's texture into my application via the OBJtoJME-Converter. I also use the ResourceLocatorTool, to get valid URLs of the .obj and the .mtl file. The object is shown correctly and it also has it's texture. My problem occurs, when I'm rotating the camera to a special direction. At this moment the application crashes and I get the following error-message:
java.lang.NullPointerException
at com.jme.scene.state.TextureState.getTexture(TextureState.java:271)
at com.jme.scene.state.lwjgl.LWJGLTextureState.apply(LWJGLTextureState.java:845)
at com.jme.renderer.lwjgl.LWJGLRenderer.applyStates(LWJGLRenderer.java:1743)
at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:979)
at com.jme.scene.TriMesh.draw(TriMesh.java:240)
at com.jme.scene.Spatial.onDraw(Spatial.java:475)
at com.jme.scene.Node.draw(Node.java:521)
at com.jme.scene.Spatial.onDraw(Spatial.java:475)
at com.jme.scene.Node.draw(Node.java:521)
at com.jme.scene.Spatial.onDraw(Spatial.java:475)
at com.jme.scene.Node.draw(Node.java:521)
at com.jme.scene.Spatial.onDraw(Spatial.java:475)
at com.jme.renderer.lwjgl.LWJGLRenderer.draw(LWJGLRenderer.java:1220)
at com.jme.renderer.pass.RenderPass.doRender(RenderPass.java:52)
at com.jme.renderer.pass.Pass.renderPass(Pass.java:96)
at com.jme.renderer.pass.BasicPassManager.renderPasses(BasicPassManager.java:90)
at com.jme.app.SimplePassGame.render(SimplePassGame.java:83)
at com.jme.app.BaseGame.start(BaseGame.java:87)
at controller.FunctionController.main(FunctionController.java:1408)
Can anyone give me a hint, where this problem actually comes from? Why is texture null and only at this specific position of my object? Do I have to refresh or update something after loading? I'm really stuck and I can't imagine where exactly this problem comes from.
Best regards,
ALEX