From 3DTiles to GLB

Hello,

I have some 3DTiles (.json with LODs folders and .b3dm files in it)

How can I convert them to .glb file?

Thanks

you can unpack the .b3dm file to .glb, for example with a tool like b3dmtoglb GitHub - CesiumGS/3d-tiles-tools

The .Json I have also contains the localization of the tiled 3d model…
I’d like to have only one glb file from the .Json and .b3dm files in LOD folders.

Thanks

By the way thanks for the answer…

My .json file has

“asset”: {
“version”: “1.0”
},

I work in a c# app and I’ve found some tools but I had problems because that tool was asking for 2.0 version.

Thanks

It might be necessary to be a bit more precise about some details here.

When you say that you have “some 3DTiles”, then I assume that you have a file tileset.json, and some subdirectories that contain the B3DM files that are used in the tileset.json.

And when you say that you have “LOD”, then I assume that this refers to the “hierarchical level of detail” that is part of 3D Tiles: There are B3DM files that have a low level of detail, and there are B3DM files that contain “the same geometry”, but with a high level of detail.

If this is correct, then … trying to convert this into a single GLB does not necessarily make sense: A single GLB does not support multiple levels of detail. (There are proposals for LOD extensions, but nothing finalized yet).

What could reasonably be done: You could combine all the B3DM files with a specific level of detail (maybe even the ones with the highest level of detail), and generate a single GLB from that.

As far as I know, there is no tool that can solve this particular task automatically.

There are tools for converting B3DM to GLB (like the one that bertt linked to), assuming that the B3DM does not contain any form of metadata.

And there (probably) are tools that can combine multiple GLBs. (I don’t know one from the tip of my head, and maybe there’s not even one that can do this trivially from the command line, but there are some powerful tools that may support this with reasonable effort - see Merging models · donmccurdy/glTF-Transform · Discussion #691 · GitHub for some discussion…)

The challenging part could then still be to figure out which B3DM files should be converted to GLB and then merged. You’d have to traverse the tile hierarchy and find the B3DMs with the “right” level of detail (and keep an eye on whether it uses ADD or REPLACE refinement…).

All this is possible, and most of it would probably not take toooo long to implement based on some existing tools, but there’s probably no convenient out-of-the-box solution for that yet.


Just a few remarks:

The .Json I have also contains the localization of the tiled 3d model…

It’s not perfectly clear what you mean by that, but I assume that this bascially refers to the location of the model on the earth. Whatever that location is, it should be possible to describe that with the appropriate transform on the root node of the resulting GLB asset.

My .json file has

“asset”: {
“version”: “1.0”
},

If this is from the tileset.json file, then this is fine.
If this is from one GLB/glTF JSON file, then this means that you are still using glTF 1.0. And glTF 1.0 is not really widely supported. There are tools that can upgrade certain glTF 1.0 files to glTF 2.0, but with maaany caveats, so you’d have to try out whether these tools work for your particular glTF asset.

Hello,

Thanks, your answer has helped me a lot.

Yes, I have a tileset.json and 3 LOD folders with .b3dm files in them.

The thing is that I have the tileset.json file well georeferenced when I use it on cesiumjs, but I’d like to convert it to a more common format so can be used in other 3D modeling softwares.

Would be ok if I have to use only the best LOD quality.

I’ll check deeper how I can achieve what I’m looking for.

Thanks