From 9f1489dc1d84910a480b7044a3f70783c2e8fffa Mon Sep 17 00:00:00 2001 From: "F.H" Date: Thu, 6 Sep 2018 21:11:00 +0200 Subject: [PATCH] Update models.c fix bug with GenMeshPlane() creating too many vertices/texcoords/normals for the plane mesh --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models.c b/src/models.c index 0d114555..bf52b30a 100644 --- a/src/models.c +++ b/src/models.c @@ -717,7 +717,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ) resZ++; // Vertices definition - int vertexCount = resX*resZ*6; // 6 vertex by quad + int vertexCount = resX*resZ; // vertices get reused for the faces Vector3 *vertices = (Vector3 *)malloc(vertexCount*sizeof(Vector3)); for (int z = 0; z < resZ; z++)