Closed zhanghai closed 7 years ago
Very nice! Two things:
ClassLoader.getResource().getFile()
. This will not work when packaging the demo as a stand-alone jar via mvn package
. Please see how other demos load assets from the classpath via DemoUtils.ioResourceToByteBuffer()aiImportFile()
can resolve the .mtl
file under the same directory. I believed to use the DemoUtils.ioResourceToByteBuffer()
method requires the implementation of an AiFileIO
interface, but I did not know how it can be done according to information I had. Could you shed some light upon this? Or I'll also look into this later.
This adds a demo for loading model with Wavefront obj and mtl format using Assimp. Rendering with lighting is also implemented in this demo.
I began to use LWJGL3 two weeks ago, but I didn't find any wiki/demo for how to load model with the new Assimp binding, so I referred to tutorials in C++ about Assimp and inspected the source of this binding, which took me a long period of time together with debugging. Hopefully this will make the experience easier for newcomers.
Screenshot: