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

Fix bugs on loadobj()

parent 5af6d9f0
No related branches found
No related tags found
No related merge requests found
......@@ -106,22 +106,6 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std::
sscanf_s(line.substr(0, charPos).c_str(), "%d%*[-//]%d", &vIndex, &vnIndex);
line.erase(0, charPos + 1);
}
}
if (line.size() > 0)
{
if (line.find("//") == std::string::npos)
{
sscanf_s(line.substr(0, charPos).c_str(), "%d%*[-/]%d%*[-/]%d", &vIndex, &uvIndex, &vnIndex);
line.erase(0, charPos + 1);
}
else
{
uvIndex = 0;
sscanf_s(line.substr(0, charPos).c_str(), "%d%*[-//]%d", &vIndex, &vnIndex);
line.erase(0, charPos + 1);
}
if (vIndex >= 1)
{
......@@ -213,7 +197,6 @@ bool openObj(const std::string fileName, std::vector<glm::vec3> &vertices, std::
return true;
}
Image *load_Image(std::string fileName, int *width, int *height, int *nrChannels)
{
fileName = "../Images/" + fileName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment