From feb55e80dae71afabb0043b218894c76c7a840ec Mon Sep 17 00:00:00 2001 From: Bigfoot71 Date: Mon, 23 Dec 2024 22:10:31 +0100 Subject: [PATCH] fix normal transform in `UpdateModelAnimation` --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 0a8e38ddb..14d4f22e7 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2380,7 +2380,7 @@ void UpdateModelAnimation(Model model, ModelAnimation anim, int frame) if (mesh.normals != NULL) { animNormal = (Vector3){ mesh.normals[vCounter], mesh.normals[vCounter + 1], mesh.normals[vCounter + 2] }; - animNormal = Vector3Transform(animNormal,model.meshes[m].boneMatrices[boneId]); + animNormal = Vector3Transform(animNormal, MatrixTranspose(MatrixInvert(model.meshes[m].boneMatrices[boneId]))); mesh.animNormals[vCounter] += animNormal.x*boneWeight; mesh.animNormals[vCounter + 1] += animNormal.y*boneWeight; mesh.animNormals[vCounter + 2] += animNormal.z*boneWeight;