You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (inti=0; i<3; i++) model.meshes[meshIndex].normals[localMeshVertexCount*3+i] =objAttributes.normals[normalIndex*3+i];
). I traced the issue to tinyobj_loader_c.h leaving the normals indexes invalid (0x80000000) if it does not detect normals. I downloaded the model from the internet so I am not 100% sure, but my guess is that it does not have any normals defined in the .OBJ file.
It should be easy to check before copying over if the indexes are valid (also for the textcoord). I can make a PR myself if this is in line with what we want.
@AndreaBoroni The issue could be related to other than normals, I checked the .obj and it contains up to 14 meshes, some define texture coordinates and some not. I think that's the issue, not the normals.
no_name -> v, vt
o Plane -> v, vt
o Car_12 -> v
o Car_11 -> v
o Car_10 -> v, vt
o Car_09 -> v
o Car_08 -> v
o Car_07 -> v, vt
o Car_06 -> v
o Car_05 -> v
o Car_04 -> v, vt
o CAR_03 -> v
o CAR_02 -> v
o CAR_01 -> v
I am trying to load an .OBJ file and I get a
Segmentation Fault
inLoadOBJ()
when copying over the normals (raylib/src/rmodels.c
Line 4416 in 99cb4cb
tinyobj_loader_c.h
leaving the normals indexes invalid (0x80000000
) if it does not detect normals. I downloaded the model from the internet so I am not 100% sure, but my guess is that it does not have any normals defined in the .OBJ file.It should be easy to check before copying over if the indexes are valid (also for the textcoord). I can make a PR myself if this is in line with what we want.
Here is a zip of the .OBJ file
Low_Poly_City_Cars.zip
The text was updated successfully, but these errors were encountered: