From cc9897316fd68556d8b7c96fb55392260d2a029a Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 9 Feb 2017 20:13:27 +0900 Subject: [PATCH] Do not exit program when there is no texture coordinate in .obj. --- examples/viewer/viewer.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/viewer/viewer.cc b/examples/viewer/viewer.cc index 19ffd5c..3df5361 100644 --- a/examples/viewer/viewer.cc +++ b/examples/viewer/viewer.cc @@ -321,8 +321,12 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3], tc[2][0] = attrib.texcoords[2 * idx2.texcoord_index]; tc[2][1] = 1.0f - attrib.texcoords[2 * idx2.texcoord_index + 1]; } else { - std::cerr << "Texcoordinates are not defined" << std::endl; - exit(2); + tc[0][0] = 0.0f; + tc[0][1] = 0.0f; + tc[1][0] = 0.0f; + tc[1][1] = 0.0f; + tc[2][0] = 0.0f; + tc[2][1] = 0.0f; } float v[3][3];