Fixed triangle fan indices

Signed-off-by: Arthur Brainville (Ybalrid) <ybalrid@ybalrid.info>
This commit is contained in:
Arthur Brainville 2018-02-27 12:47:06 +01:00
parent de8e3a6e6b
commit c227c5bddb
No known key found for this signature in database
GPG Key ID: BC05C4812A06BCF3

View File

@ -157,7 +157,7 @@ bool LoadGLTF(const std::string &filename, float scale,
// Push back the indices that describe just one triangle one by one // Push back the indices that describe just one triangle one by one
for (size_t i{2}; i < triangleFan.size(); ++i) { for (size_t i{2}; i < triangleFan.size(); ++i) {
loadedMesh.faces.push_back(triangleFan[0]); loadedMesh.faces.push_back(triangleFan[0]);
loadedMesh.faces.push_back(triangleFan[1]); loadedMesh.faces.push_back(triangleFan[i - 1]);
loadedMesh.faces.push_back(triangleFan[i]); loadedMesh.faces.push_back(triangleFan[i]);
} }
} }
@ -473,4 +473,4 @@ bool LoadGLTF(const std::string &filename, float scale,
return ret; return ret;
} }
} }
} // namespace example } // namespace example