This is a tiny library that loads obj files in the browser. The objective of this libary is to assists loading of ".obj" and ".mtl" files through wasm. Since wasm doesn't support file operations, the libary relies on getting the data from javascript. Therefore it relies on the fetch operation provided by the browser. Current features include:
- Parsing the ".obj" and ".mtl" files.
- Creating a basic tree from the ".obj" file.
The idea in this libary is dead simple and further features are on the hold.
-
TODO
[ ] Load textures materials.
[ ] Support indexing to load the vertices.
[ ] Better support for error handling.
This library is heavily inpsired by Assimp and tobj
use obj::reader::*;
let mut reader = ObjReader::new()?;
reader.read(&self.scene_data, &self.mat_data);
Reader will now have the scene graph. You can access different data from the scene graph.