WIP: bugfixing

This commit is contained in:
2022-04-24 09:57:52 +03:00
parent a0deddb660
commit f9b82f4397
8 changed files with 59 additions and 47 deletions
+3 -2
View File
@@ -43,8 +43,9 @@ void mesh::render(bool flat_shaded) {
}
// fill in buffer
int i = 0;
for (auto &f: facets) {
size_t i = 0;
for (size_t face_index = 0; i < facets.size(); i++) {
auto& f = facets[face_index];
for (int j = 0; j < 3; j++) {
vbo_data[i++] = vertices[f.vertices[j]].position.x;
vbo_data[i++] = vertices[f.vertices[j]].position.y;