diff options
| author | raysan5 <[email protected]> | 2020-07-17 18:22:09 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2020-07-17 18:22:09 +0200 |
| commit | 642f42bb4f182004ded5d6b093668bca5ca8c279 (patch) | |
| tree | 33312dcaa77c64344770378bd44d59095f2c1a8f /src | |
| parent | bdd253a66ad4944b07d29a8533b795fd214c33fd (diff) | |
| download | raylib-642f42bb4f182004ded5d6b093668bca5ca8c279.tar.gz raylib-642f42bb4f182004ded5d6b093668bca5ca8c279.zip | |
Reviewed comment in LoadIQM() #1315
Diffstat (limited to 'src')
| -rw-r--r-- | src/models.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/models.c b/src/models.c index fd423309..e34099e6 100644 --- a/src/models.c +++ b/src/models.c @@ -3243,7 +3243,9 @@ static Model LoadIQM(const char *fileName) for (unsigned int i = imesh[m].first_triangle; i < (imesh[m].first_triangle + imesh[m].num_triangles); i++) { - // IQM triangles are stored counter clockwise, but raylib sets opengl to clockwise drawing, so we swap them around + // IQM triangles indexes are stored in counter-clockwise, but raylib processes the index in linear order, + // expecting they point to the counter-clockwise vertex triangle, so we need to reverse triangle indexes + // NOTE: raylib renders vertex data in counter-clockwise order (standard convention) by default model.meshes[m].indices[tcounter + 2] = tri[i].vertex[0] - imesh[m].first_vertex; model.meshes[m].indices[tcounter + 1] = tri[i].vertex[1] - imesh[m].first_vertex; model.meshes[m].indices[tcounter] = tri[i].vertex[2] - imesh[m].first_vertex; |
