-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documenting the main data structures #2
Comments
This C89 version is currently experimental, so less document at this time. API is mostly similar with C++ version, thus you'll find enough information about it there: https://github.com/syoyo/tinyobjloader |
I decided to use Loading a simple triangulated cube for reference I got:
Vertex, texcoords and normals look ok to me but I have the feeling that |
Possible. Still, If you find an issue, please file an issue with reproducable code and .obj file. |
It seems @andystanton suspects so too! tinyobjloader-c/test/tinyobj_api_tests.c Line 102 in a56a006
I just ran into this myself too. |
I am also having some confusion determining what some of the main struct names actually mean. I'm going to do a little more comparison against the c++ version to see how their variables are named. |
The following are some descriptions as far as I can decipher. Comparing against c++ version, I believe (c | c++): face_num_verts == num_face_vertices TINYOBJ_MAX_FACES_PER_F_LINE tinyobj_vertex_index_t parseLine() Functionnum_f f_num_verts num_f_num_verts tinyobj_parse_obj() Functionattrib->num_face_num_verts So, yes the code needs a patch. A couple of lines should read as follows. 1378: attrib->num_faces = (unsigned int)num_faces; I think the other issues are purely with regard to variable names being more clear. |
@mj-saunders Awesome! Let me give some time to review your description. |
@syoyo No problem. Hopefully what I've written is actually correct ;) |
Also, I have not confirmed this, but I have a feeling that It only counts F "commands" (lines in the obj file beginning with f), whereas triangulation will have caused extra faces to be added to the final array. Please correct me if I have just misunderstood something. |
Firstly, current naming of variables are confusing #16 so I am planning to rename it. I'd like to follow USD's naming: https://graphics.pixar.com/usd/docs/api/class_usd_geom_mesh.html
Then things will be much cleaner(and need to rewrie the description) |
Hello!
This is a nice library, but I had a bit of trouble using it because I didn't quite understand what was contained in the main data structures.
In my opinion, that is the most important thing to document.
For instance: the members in 'tinyobj_attrib_t' struct could use some comments.
In particular, the members: 'num_faces', 'num_face_num_verts', 'faces' and 'face_num_verts'.
What are their relationships, and how they are affected by the TINYOBJ_FLAG_TRIANGULATE flag?
The text was updated successfully, but these errors were encountered: