Do not exit program when there is no texture coordinate in .obj.

This commit is contained in:
Syoyo Fujita
2017-02-09 20:13:27 +09:00
parent e43580bd9a
commit cc9897316f

View File

@@ -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];