Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thisistherk/fast_obj
Fast C OBJ parser
https://github.com/thisistherk/fast_obj
Last synced: about 2 months ago
JSON representation
Fast C OBJ parser
- Host: GitHub
- URL: https://github.com/thisistherk/fast_obj
- Owner: thisistherk
- License: mit
- Created: 2018-07-29T12:31:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T19:41:52.000Z (7 months ago)
- Last Synced: 2024-08-04T02:09:26.801Z (5 months ago)
- Language: C++
- Homepage:
- Size: 132 KB
- Stars: 592
- Watchers: 15
- Forks: 46
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeCppGameDev - fast_obj
README
# fast_obj
Because the world needs another OBJ loader.
Single header library, should compile without warnings in both C89 or C++.
Much faster (5-10x) than other libraries tested.To use:
fastObjMesh* mesh = fast_obj_read("path/to/objfile.obj");
...do stuff with mesh...
fast_obj_destroy(mesh);
Note that valid indices in the `fastObjMesh::indices` array start from `1`. A dummy position, normal and
texture coordinate are added to the corresponding `fastObjMesh` arrays at element `0` and then an index
of `0` is used to indicate that attribute is not present at the vertex. This means that users can avoid
the need to test for non-present data if required as the vertices will still reference a valid entry in
the mesh arrays.A simple test app is provided to compare speed against [tinyobjloader](https://github.com/syoyo/tinyobjloader) and
check output matches.### Version 1.3
Version 1.3 makes a small change to the API. Textures are now stored in a separate array on the
`fastObjMesh` structure, and are referenced by index from materials, instead of being referenced
by the material directly.