CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.68k stars 303 forks source link

Normal index 12868 is out of bounds #243

Open congtong opened 4 years ago

congtong commented 4 years ago

When I execute this command node obj2gltf/bin/obj2gltf.js -i model.obj -o box.gltf

An error like this occurs: Normal index 12868 is out of bounds

lilleyse commented 4 years ago

@congtong can you upload the obj model so we can help debug?

congtong commented 4 years ago

@lilleyse thanks!

model.zip

lilleyse commented 3 years ago

@congtong there's a few nan's in the obj which is causing the parser to skip those lines

vn 0 -0.00000023035368 1
vn nan nan nan
vn -0.17363405227661 0 -0.98481023311615
vn -0.63710129261017 -0.63440746068954 0.43775460124016
vn -0.34200474619865 0 -0.93969821929932
vn nan nan nan
vn -0.5000251531601 0 -0.86601090431213
vn -0.50270861387253 -0.61126267910004 0.61126267910004
vn -0.64278835058212 0 -0.76604384183884
vn -1 -0.00000000000086 0
vn -0.76603543758392 0 -0.6427983045578
vn nan nan nan
vn -0.00016898373724 -0.70710676908493 0.70710676908493
vn -0.86602908372879 0 -0.49999359250069

Are you using Vectorworks? I saw a similar bug report in assimp: https://github.com/assimp/assimp/issues/2428

bennlich commented 3 years ago

It looks like assimp decided to coerce NaNs to 0s: https://github.com/assimp/assimp/pull/2429

uc-asa commented 1 year ago

I'm also facing the same with but with a bit different message 'Normal index 47 is out of bounds'