A few months ago, I wrote a java obj format loader that should do what you need. It is on the git at node;
https://github.com/seanrowens/oObjLoader
Please note that README says that this is pre-alpha - this is primarily because almost no one has seen it yet.
It parses most of the .obj format as well as the .mtl format. Now, what does he do with what he analyzes ... well, I tried using a SAX-like approach. There is a Parser that calls methods on the BuilderInterface with each parsed element. There is a simple sample implementation of BuilderInterface, as well as a simple LWJGL viewer application that ties it all together.
Currently, he does nothing useful in more exotic formulations of geometry, that is, nothing but vertices and polygons, in other words, he ignores any geometry except vertices and polygons. It parses and captures .mtl files, but the real viewer does not implement anything but very very simple textures.
I would be glad to hear any feedback and advice. The license is extremely liberal:
This code was written by me, Sean R. Owens, Sean on the guild network, and released into the public domain. Share and enjoy. Since some people claim that it is not possible to release software for the public domain, you can also use this code under any version of the GPL, LPGL, Apache or BSD, or contact me to use a different license.
source share