August 10th, 2008
Java .OBJ loader
For the next game in C++, I wrote an OBJ Loader. I decided to port it to JAVA and used my favorite Java OpenGL binding for rendition: LWJGL.
Try it and Source Code
- Try it(JNLP).
Source Code. The loader has became quit popular, Victor Martin from pixelnerve.com will now maintain it. The source Code is here.
Features
This Java OBJ Loader support:
- Groups
- Vertex, Normal, Texture coordinate
- MTL (material) references.
- Texture Loading (including Alpha for PNG)
- LWJGL Rendition with DisplayList
This Java OBJ Loader DOES NOT support:
- Relative vertex references.
- Anything other than GL_TRIANGLE and GL_QUAD polygons
How-To
I extracted the Ikaruga Models to test this loader. If anybody wonder how to do it, this is what you need:
- An Ikaruga CD (DreamCast prefered)
- A PVR viewer (PVR is the texture format in the dreamcast) ( Use Pvr2png for batch conversion and PVRViewer for special files). A bit or reading about the Sega PVT GBIX format: here
- A PVM decompressor (PVR files are stored inside PVM archives). pvmupk will do the job.
- A NJ (Sega/DreamCast format object model format, AKA Ninja) reader. I used Exmldnet, but their version is bugged (texture names are truncated among other things). As they were kind enough to publish the source code, I fixed it. Fix was sent but there is no update, so in the meantime you can download the latest version from here.
- A lot of enthousiasm ;) !
Screenshots
In case you wonder, the kanji on the right in each screenshot mean "Never give up"...
@