How do I get 3D Tiles declarative styling work on models converted from COLLADA?

Dear Forum,

I have a city model containing a bunch of buildings in .dae format, extracted from Google Earth .kmz files, each in their structured directory. I want this city model to be published as 3D Tiles and color the buildings by their attributes, for example by their street names.

I worked through quite a long way using dae2gltf, gltf-pipeline and finally glbtob3dm. It appears to me, however, that even if I manage to provide the tileset.json, there's no way I can bind the attributes to the building model.

I read this discussion about binding attributes/properties to the building for styling:
https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/136

To do that I'll need at least a BATCH_ID for each building model. But glbtob3dm does not automatically provide a BATCH_ID or option to attach an BATCH_ID to the model so that's not possible.

I've also find this thinking of using tileset.json for styling here:
https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/16

But this issue is closed and I'm not sure why and whether this solved by some other approach.

So is there a way I can workaround to achieve what I want? Sounds to me by modifying the .b3dm I can get the BATCH_ID:
https://groups.google.com/forum/#!topic/cesium-dev/sev1aUV6nBI
and after that I can use model.color for the styling?

Or is there a different route I can take to make the styling of 3D Tiles happen, when it's converted from a COLLADA .dae model?

BTW I'm using Cesium 1.34 on a Win10 desktop, Node.js 4.8. Not sure if these are relevant to my question, though.

Thanks in advance.

Hi,

Batch ids are definitely the main missing element here, and styling is not possible without them. Are you already batching individual buildings together into b3dm tiles? During that process you will need to assign batch ids. As you’ve noticed the open source tools don’t support batch ids at the moment so this work is up to you. I left a few notes on another thread that might be helpful: https://groups.google.com/d/msg/cesium-dev/qMKvqBUGsoE/7w05FYUtBwAJ.

The issue https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/16 was closed because we decided that the tileset and style should be separate concepts. In Cesium you would load the tileset first and then set tileset.style = new Cesium3DTileStyle(path_or_json_object). Or if you don’t want to write a style with JSON, you can operate directly on the features of a tile. Batched3DModel3DTileContent and other tile formats have a getFeature function that returns the feature with the given batch id. From there you can change its color. This is definitely preferable to using model.color, which would change the color for the entire tile instead of the individual feature.

Sorry there isn’t a simpler answer for the batch ids.

Hi Sean,

Thanks for the information. I'm not aware of a specific open source package to "batch" buildings into tiles, but I managed to batch-convert each individual glb's of the buildings into the .b3dm counter part (using glbtob3dm). And that's where I got stuck.

I checked out the thread you pointed to, and it doesn't seem like I can do the job without investing some fair amount of time-- or money. That function <modifyGltfWithBatchIds> looks promising, though.

Thanks again for the great hints.

Meng