Fixed being stuck in an infinite loop whilst loading model indecies
This commit is contained in:
parent
753ec9c857
commit
685aafd45f
2 changed files with 3 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ Mesh Model::processMesh(aiMesh *mesh, const aiScene *scene) {
|
||||||
}
|
}
|
||||||
// Handle indeces
|
// Handle indeces
|
||||||
// Loop through the meshes faces to get the correct order
|
// Loop through the meshes faces to get the correct order
|
||||||
for (unsigned int i = 0; mesh->mNumFaces; i++) {
|
for (unsigned int i = 0; i < mesh->mNumFaces; i++) {
|
||||||
aiFace face = mesh->mFaces[i];
|
aiFace face = mesh->mFaces[i];
|
||||||
// loop through and add each face's indecies
|
// loop through and add each face's indecies
|
||||||
for (unsigned int faceIndicie = 0; faceIndicie < face.mNumIndices;
|
for (unsigned int faceIndicie = 0; faceIndicie < face.mNumIndices;
|
||||||
|
|
@ -79,7 +79,7 @@ Mesh Model::processMesh(aiMesh *mesh, const aiScene *scene) {
|
||||||
indecies.push_back(face.mIndices[faceIndicie]);
|
indecies.push_back(face.mIndices[faceIndicie]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO Handle Assimps material format
|
// Handle Assimps material format
|
||||||
if (mesh->mMaterialIndex >= 0) {
|
if (mesh->mMaterialIndex >= 0) {
|
||||||
aiMaterial *material = scene->mMaterials[mesh->mMaterialIndex];
|
aiMaterial *material = scene->mMaterials[mesh->mMaterialIndex];
|
||||||
std::vector<Texture> diffuseMaps = loadMaterialTextures(
|
std::vector<Texture> diffuseMaps = loadMaterialTextures(
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
model.translate(glm::vec3(1.0f, 0.0f, 0.0f));
|
model.translate(glm::vec3(1.0f, 0.0f, 0.0f));
|
||||||
|
|
||||||
Model backpack(ROOT_DIR "data/models/backpack/backpack.mtl");
|
Model backpack(ROOT_DIR "data/models/backpack/backpack.obj");
|
||||||
|
|
||||||
// Mess with perspective
|
// Mess with perspective
|
||||||
// Projection matrix : 45° Field of View, 4:3 ratio, display range : 0.1
|
// Projection matrix : 45° Field of View, 4:3 ratio, display range : 0.1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue