diff --git a/MshViewer/Source/OpenGlController.cpp b/MshViewer/Source/OpenGlController.cpp index 74871d8..461bb2a 100644 --- a/MshViewer/Source/OpenGlController.cpp +++ b/MshViewer/Source/OpenGlController.cpp @@ -410,16 +410,15 @@ void OpenGLController::loadMsh(const char * path) ///////////////////////////////////////////////////////////////////////////////////////// /////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 { - // for every edge of the polygon (in that case 3) - for (int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) // for every edge of the polygon { Vertex tempVertex; // every edge has 3 coordinates @@ -435,7 +434,7 @@ void OpenGLController::loadMsh(const char * path) else { 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); }