Closed venidev closed 6 years ago
As of right now, this WebGL Obj Loader is not directly compatible with ThreeJS (there are no helper functions to convert to ThreeJS). For some reason it is not documented, but ThreeJS does have an OBJ loader. An example of it being used can be found here: http://mrdoob.github.com/three.js/examples/webgl_loader_obj.html
Look for the line in the main <script>
tag that looks like this: var loader = new THREE.OBJLoader();
An even handler is added, followed by the OBJ file to load: loader.load( 'obj/male02/male02.obj' );
At least for the creation of this loader, it was originally intended for my WebGL graphics class to be low level so that we all could learn WebGL without having to hard code models (and ugly ones at that). However, I will see if I can make it compatible with ThreeJS (although, I would highly suggest checking out their Obj Loader first).
Thanks for the interest!
I appreciate the current API. If this compatibility can be added without changing the existing API, I'm for that, but I'm using this library without Three.JS as well.
ThreeJS supplies its own OBJ and MTL loaders that work well with ThreeJS, so this issue will not be worked. The focus of this library is to be a simple parser/loader specifically for the OBJ/MTL formats and should be structured in such a way that helps facilitate the learning of WebGL and its underlying shading languages.
Thanks for the obj loader, very helpful library. Is it possible to use the Mesh in other libraries like ThreeJS?