Spatial scan obj file won't load into Babylon

I have an obj file that represents a spatial scan from a HoloLens device. This file loads correctly on other 3D viewers, but not on Babylon, the loading spinner never goes away and there is a JavaScript error in the console (in the playground link below, it just never loads anything). I have tried configuring the engine options for uintIndices and that did not make any difference. I also tried with a smaller spatial scan mesh (i.e. less vertices) and that did not work either.

image

As for the Playground, there is wrong link to your file. It should be
https://raw.githubusercontent.com/jery45/babylonjs-bug/main/scan_2020-11-30%2020_41_13Z.obj

But I had no success to load your file into Sandbox, and this is really strange. Meanwhile it is OK at https://3dviewer.net/ .

Thank you for the link correction – I went ahead and updated the sandbox code.

Yes, it opens just fine at 3dviewer.net but not in Babylon.js. Any help would be appreciated.

I don’t think your file is valid because the faces data point to normals/uvs that don’t exist in the file.

For eg, the last line in the file is:

f 85946/85946/85946 85945/85945/85945 85944/85944/85944

It should be:

f 85946 85945 85944

instead.

Same thing for all “f” lines.

After these corrections it does work:

https://playground.babylonjs.com/#Y5PN0X#3

1 Like

We changed the way we were exporting the file and it worked correctly this time. Thank you for your help!!

2 Likes