Reputation: 766
I am trying to load a Wavefront Object into my C++ OpenGL program using my own parser. The parser works for some .obj-files, but at some files it throws an index out of range exception
. After some debugging I recognized that one line in the file references a vertex with the number 10565
:
f 2571/5164/4481 8298/5166/4481 10565/5167/4481
^^^^^
But the file only contains 10531
vertices.
Questions:
Upvotes: 0
Views: 557
Reputation: 7079
The best answer will be in the source -
svn co "https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/io_scene_obj/"
My guess would be to ignore erroneous faces, the other option would be to locate the nearby vertex most likely to be connected to the other two vertices.
Upvotes: 1