You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This "Example code (New Object Oriented API)" code works well to read in cornell_box.obj. There's just one minor issue flagged by Visual Studio, that "v" and "fv" are of different types (size_t vs. int).
I gave it a compile and run, the added code worked fine. Is there a way to test if there are RGB colors per vertex? I never use that format, so don't know about it.
// Optional: vertex colors
// tinyobj::real_t red = attrib.colors[3*idx.vertex_index+0];
// tinyobj::real_t green = attrib.colors[3*idx.vertex_index+1];
// tinyobj::real_t blue = attrib.colors[3*idx.vertex_index+2];
Anyway, other than that bonus test, if there is one, looks good.
Describe the issue
For this main readme file: https://github.com/tinyobjloader/tinyobjloader/blob/master/README.md#example-code-new-object-oriented-api
This "Example code (New Object Oriented API)" code works well to read in cornell_box.obj. There's just one minor issue flagged by Visual Studio, that "v" and "fv" are of different types (size_t vs. int).
But, the access code:
fails and asserts when it tries to read the normals, because there are no normals computed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Here's the fixed code I suggest for the example:
Environment
The text was updated successfully, but these errors were encountered: