fixed the uv problem

This commit is contained in:
Anakin 2016-11-20 12:38:22 +01:00
parent 57df0a2e15
commit 9ac1a25954
1 changed files with 5 additions and 6 deletions

View File

@ -410,16 +410,15 @@ void OpenGLController::loadMsh(const char * path)
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
/////DEV ZONE /////DEV ZONE
for (auto& modIt : vModels) for (auto& modIt : vModels) // for every model chunk
{ {
for (auto& segIt : modIt->segmLst) for (auto& segIt : modIt->segmLst) // for every cluster
{ {
for (auto& mshIt : segIt->meshIndices) for (auto& mshIt : segIt->meshIndices) // for every polygon
{ {
if (mshIt->size() == 3) // already triangulated if (mshIt->size() == 3) // already triangulated
{ {
// for every edge of the polygon (in that case 3) for (int i = 0; i < 3; i++) // for every edge of the polygon
for (int i = 0; i < 3; i++)
{ {
Vertex tempVertex; Vertex tempVertex;
// every edge has 3 coordinates // every edge has 3 coordinates
@ -435,7 +434,7 @@ void OpenGLController::loadMsh(const char * path)
else else
{ {
for (int j = 0; j < 2; j++) for (int j = 0; j < 2; j++)
tempVertex.uv[j] = (GLfloat)segIt->uv[(*mshIt)[i] * 3 + j]; tempVertex.uv[j] = (GLfloat)segIt->uv[(*mshIt)[i] * 2 + j];
} }
tempBufferData.push_back(tempVertex); tempBufferData.push_back(tempVertex);
} }