adding tex coords

This commit is contained in:
Dynamitos
2025-01-25 19:20:12 +01:00
parent 60e8548c7d
commit 1fef8e6cba
4 changed files with 9 additions and 5 deletions
+1
View File
@@ -21,6 +21,7 @@ class Model
public:
AABB boundingBox;
std::vector<glm::vec3> positions;
std::vector<glm::vec2> texCoords;
std::vector<glm::uvec3> indices;
std::vector<glm::vec3> edges;
std::vector<glm::vec3> faceNormals;
+1
View File
@@ -19,6 +19,7 @@ std::vector<PModel> ModelLoader::loadModel(std::string_view filename)
{
auto aiVert = mesh->mVertices[v];
model->positions.push_back(glm::vec3(aiVert.x, aiVert.y, aiVert.z));
model->texCoords.push_back(glm::vec2(mesh->mTextureCoords[0][v].x, mesh->mTextureCoords[0][v].y));
aabb.adjust(model->positions.back());
}
for (int i = 0; i < mesh->mNumFaces; ++i)