Skip to content
Snippets Groups Projects
Commit 6820c1ce authored by Woohyung Choi's avatar Woohyung Choi
Browse files

improve stability of loadobj().

parent 593f1e75
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,8 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std:: ...@@ -167,6 +167,8 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std::
log_warn(infoLog, fileName + " : " + "faceVertexIndices.size() : " + std::to_string(faceVertexIndicies.size())); log_warn(infoLog, fileName + " : " + "faceVertexIndices.size() : " + std::to_string(faceVertexIndicies.size()));
} }
if (faceVertexTexCoordIndicies.size() > 0)
{
if (faceVertexTexCoordIndicies.size() == 3) if (faceVertexTexCoordIndicies.size() == 3)
{ {
vertexTexCoord.push_back(vertexTexCoordIndices[faceVertexTexCoordIndicies[0]]); vertexTexCoord.push_back(vertexTexCoordIndices[faceVertexTexCoordIndicies[0]]);
...@@ -188,6 +190,7 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std:: ...@@ -188,6 +190,7 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std::
GLchar infoLog[512] = { 0, }; GLchar infoLog[512] = { 0, };
log_warn(infoLog, fileName + " : " + "vertexTexCoordIndices.size() : " + std::to_string(faceVertexTexCoordIndicies.size())); log_warn(infoLog, fileName + " : " + "vertexTexCoordIndices.size() : " + std::to_string(faceVertexTexCoordIndicies.size()));
} }
}
if (faceVertexNormalIndicies.size() == 3) if (faceVertexNormalIndicies.size() == 3)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment