Update obj.cpp
This commit is contained in:
@@ -65,6 +65,7 @@ void Model::loadOBJ(const std::string& filename) {
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
textureInfo.push_back({"", uvs});
|
||||
};
|
||||
|
||||
// map face of model to positions and texture coords
|
||||
@@ -72,12 +73,12 @@ void Model::mapFaces(const FaceIndices& facedata, const std::vector<Vector3>& po
|
||||
std::vector<Vector2> textureCoordinates;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
Vector3 vertex;
|
||||
Vector2 textureCoordinate;
|
||||
//Vector2 textureCoordinate;
|
||||
vertex = positions[facedata.vertexIndex[i]];
|
||||
textureCoordinate = uvs[facedata.texCoordIndex[i]];
|
||||
//textureCoordinate = uvs[facedata.texCoordIndex[i]];
|
||||
vertices.push_back(vertex);
|
||||
indices.push_back(static_cast<unsigned int>(indices.size()));
|
||||
textureCoordinates.push_back(textureCoordinate);
|
||||
//textureCoordinates.push_back(textureCoordinate);
|
||||
}
|
||||
textureInfo.push_back({"", textureCoordinates});
|
||||
}
|
Reference in New Issue
Block a user