Commit 9ac1a259 authored by Anakin's avatar Anakin

fixed the uv problem

parent 57df0a2e
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment