Fix GenMeshPlane when resX != resZ

This commit is contained in:
Stanislav Yablonskiy 2023-10-15 18:34:30 +03:00
parent 18bedbd095
commit 0b21e5d5ac

View File

@ -2249,7 +2249,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ)
for (int face = 0; face < numFaces; face++)
{
// Retrieve lower left corner from face ind
int i = face % (resX - 1) + (face/(resZ - 1)*resX);
int i = face + face / (resX - 1);
triangles[t++] = i + resX;
triangles[t++] = i + 1;