fixed the uv problem
This commit is contained in:
parent
57df0a2e15
commit
9ac1a25954
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user