Fast C OBJ parser
Find a file
Sergey Kosarevsky fce8123891 Update CMake file to CMake version 3.5...3.31
This approach allows us to maintain compatibility with the minimum supported CMake version 3.5,
while suppressing all policy warnings up to the latest version 3.31.
2024-12-06 16:46:51 -08:00
.clusterfuzzlite Add ClusterFuzzLite integration 2023-12-21 04:19:45 -08:00
.github/workflows Add ClusterFuzzLite integration 2023-12-21 04:19:45 -08:00
test Merge all face/index arrays together 2019-06-11 07:35:30 -07:00
.gitignore Add .gitignore file 2019-05-19 09:51:43 +01:00
CMakeLists.txt Update CMake file to CMake version 3.5...3.31 2024-12-06 16:46:51 -08:00
fast_obj.c Add fast_obj.c to allow compilation as standalone library if required 2020-05-23 16:25:05 +01:00
fast_obj.h Bump version number to 1.3 2024-06-04 20:27:55 +01:00
LICENSE Initial commit 2018-07-29 13:31:09 +01:00
README.md Small note about API change in 1.3 2024-06-04 20:31:38 +01:00

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 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.