Skip to content

Commit cc98973

Browse files
committed
Do not exit program when there is no texture coordinate in .obj.
1 parent e43580b commit cc98973

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/viewer/viewer.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,12 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
321321
tc[2][0] = attrib.texcoords[2 * idx2.texcoord_index];
322322
tc[2][1] = 1.0f - attrib.texcoords[2 * idx2.texcoord_index + 1];
323323
} else {
324-
std::cerr << "Texcoordinates are not defined" << std::endl;
325-
exit(2);
324+
tc[0][0] = 0.0f;
325+
tc[0][1] = 0.0f;
326+
tc[1][0] = 0.0f;
327+
tc[1][1] = 0.0f;
328+
tc[2][0] = 0.0f;
329+
tc[2][1] = 0.0f;
326330
}
327331

328332
float v[3][3];

0 commit comments

Comments
 (0)