Chapter 9 | OBJLoader Problem.
Opened this issue · 3 comments
I'm very dumb, however, does anybody know what I should look for?
java.lang.NullPointerException
at java.io.Reader.(Reader.java:78)
at java.io.InputStreamReader.(InputStreamReader.java:72)
at me.gitvika.Game.engine.Utils.readAllLines(Utils.java:32)
at me.gitvika.Game.engine.graph.OBJLoader.loadMesh(OBJLoader.java:23)
at me.gitvika.Game.game.DummyGame.init(DummyGame.java:54)
at me.gitvika.Game.engine.GameEngine.init(GameEngine.java:49)
at me.gitvika.Game.engine.GameEngine.run(GameEngine.java:36)
at me.gitvika.Game.game.Hill.main(Hill.java:13)
java.lang.NullPointerException
at me.gitvika.Game.game.DummyGame.cleanup(DummyGame.java:100)
at me.gitvika.Game.engine.GameEngine.cleanup(GameEngine.java:78)
at me.gitvika.Game.engine.GameEngine.run(GameEngine.java:41)
at me.gitvika.Game.game.Hill.main(Hill.java:13)
Hi,
In this chapter, files are loaded from the CLASSPATH, so the folder that contains the models (named models
), should be in the CLASSPATH. If you execue the samples from an IDE it should be done automatically. If you build the solutions with maven, those resources should be also in the CLASSPATH.
Anyway, I'm seriuosly thinking on changing this and use "regular" paths to be more consistent. Loading from the CLASSPATH is useful because you can embed some resources in the applictaion JAR, but with the usage of Assimp and STB in other chapters it is not consistent. It is kinf of work though, so I'm resisting to it.
Should I close this issue?
Should I close this issue?
You can! I figured it out.