mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Merge pull request #190 from daeunSong/master
Fix texture coordinate tangent and bitangent calculation
This commit is contained in:
@@ -115,9 +115,6 @@ private:
|
|||||||
vec.x = mesh->mTextureCoords[0][i].x;
|
vec.x = mesh->mTextureCoords[0][i].x;
|
||||||
vec.y = mesh->mTextureCoords[0][i].y;
|
vec.y = mesh->mTextureCoords[0][i].y;
|
||||||
vertex.TexCoords = vec;
|
vertex.TexCoords = vec;
|
||||||
}
|
|
||||||
else
|
|
||||||
vertex.TexCoords = glm::vec2(0.0f, 0.0f);
|
|
||||||
// tangent
|
// tangent
|
||||||
vector.x = mesh->mTangents[i].x;
|
vector.x = mesh->mTangents[i].x;
|
||||||
vector.y = mesh->mTangents[i].y;
|
vector.y = mesh->mTangents[i].y;
|
||||||
@@ -128,6 +125,10 @@ private:
|
|||||||
vector.y = mesh->mBitangents[i].y;
|
vector.y = mesh->mBitangents[i].y;
|
||||||
vector.z = mesh->mBitangents[i].z;
|
vector.z = mesh->mBitangents[i].z;
|
||||||
vertex.Bitangent = vector;
|
vertex.Bitangent = vector;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vertex.TexCoords = glm::vec2(0.0f, 0.0f);
|
||||||
|
|
||||||
vertices.push_back(vertex);
|
vertices.push_back(vertex);
|
||||||
}
|
}
|
||||||
// now wak through each of the mesh's faces (a face is a mesh its triangle) and retrieve the corresponding vertex indices.
|
// now wak through each of the mesh's faces (a face is a mesh its triangle) and retrieve the corresponding vertex indices.
|
||||||
|
|||||||
Reference in New Issue
Block a user