Browse Source

Update rmodels.c

pull/4139/head
Ray 6 months ago
parent
commit
b8e5179431
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/rmodels.c

+ 3
- 3
src/rmodels.c View File

@ -5172,7 +5172,7 @@ static Model LoadGLTF(const char *fileName)
// Transform the vertices // Transform the vertices
float *vertices = model.meshes[meshIndex].vertices; float *vertices = model.meshes[meshIndex].vertices;
for (int k = 0; k < attribute->count; k++)
for (unsigned int k = 0; k < attribute->count; k++)
{ {
Vector3 vt = Vector3Transform((Vector3){ vertices[3*k], vertices[3*k+1], vertices[3*k+2] }, worldMatrix); Vector3 vt = Vector3Transform((Vector3){ vertices[3*k], vertices[3*k+1], vertices[3*k+2] }, worldMatrix);
vertices[3*k] = vt.x; vertices[3*k] = vt.x;
@ -5196,7 +5196,7 @@ static Model LoadGLTF(const char *fileName)
// Transform the normals // Transform the normals
float *normals = model.meshes[meshIndex].normals; float *normals = model.meshes[meshIndex].normals;
for (int k = 0; k < attribute->count; k++)
for (unsigned int k = 0; k < attribute->count; k++)
{ {
Vector3 nt = Vector3Transform((Vector3){ normals[3*k], normals[3*k+1], normals[3*k+2] }, worldMatrixNormals); Vector3 nt = Vector3Transform((Vector3){ normals[3*k], normals[3*k+1], normals[3*k+2] }, worldMatrixNormals);
normals[3*k] = nt.x; normals[3*k] = nt.x;
@ -5220,7 +5220,7 @@ static Model LoadGLTF(const char *fileName)
// Transform the tangents // Transform the tangents
float *tangents = model.meshes[meshIndex].tangents; float *tangents = model.meshes[meshIndex].tangents;
for (int k = 0; k < attribute->count; k++)
for (unsigned int k = 0; k < attribute->count; k++)
{ {
Vector3 tt = Vector3Transform((Vector3){ tangents[3*k], tangents[3*k+1], tangents[3*k+2] }, worldMatrix); Vector3 tt = Vector3Transform((Vector3){ tangents[3*k], tangents[3*k+1], tangents[3*k+2] }, worldMatrix);
tangents[3*k] = tt.x; tangents[3*k] = tt.x;

Loading…
Cancel
Save