ebeaufay / threedtiles

3DTiles viewer for three.js
MIT License
270 stars 32 forks source link

TypeError: Cannot read properties of undefined (reading 'uri') #3

Closed Ya2gLu closed 2 years ago

Ya2gLu commented 2 years ago

I am replaced with my own path in the index.js file: image

The result is an error in the loader.js file: image

This is the TileSet.json format I have: image

Is it a problem with the structure?

ebeaufay commented 2 years ago

The part of the Json you shared looks fine. Can you check that further down that you don't have an empty "content" object? If so, it might be that the parser fails in that case.

I can check in the 3dtiles spec if this is actually allowed but I propose the lib should support empty "content" regardless.

Ya2gLu commented 2 years ago

I checked my JSON file and found that there is no empty "content" object.

It seems that it doesn't seem this problem ...

ebeaufay commented 2 years ago

Ok, if you can share the tileset I will fix

ebeaufay commented 2 years ago

if you can only share the tileset.json file, that can be enough

Ya2gLu commented 2 years ago

This is my JSON file link: tileset.json

Ya2gLu commented 2 years ago

In addition, there is a directory structure of my file image

There is a TileSet.json file in each directory. image

ebeaufay commented 2 years ago

Ok, the issue is fixed. the code didn't support an empty root tile without a "content" object.

Try it out and don't forget to play around with "setGeometricErrorMultiplier" if the performance is bad.

Not sure what the tiling scheme is in the other jsons. For example in the folder BlockABAA, do you have several levels of detail?

If you want, I have code to re-tile the entire dataset from OBJ to optimal tiles. However I don't give this code out but I can process your dataset for you.

Ya2gLu commented 2 years ago

yes, i see

I need to convert the OSGB format to B3DM. But the directory structure and you don't seem different...

Do you have any way?🙏🙏

ebeaufay commented 2 years ago

I think "osgconv" can convert your osgb files to obj. Download the openSceneGraph binaries here (http://www.openscenegraph.org/index.php/download-section/stable-releases) and run for every file : osgconv model.osg model.obj

If your dataset is small (less than 100mb) just load the highest level of detail OBJs in threejs directly. Else, you can send them to me and I can convert them to optimal 3dtiles.

How about the 3dtiles you have now, did the fix work?

ebeaufay commented 2 years ago

closing issue if no more comments