Disable children in a 3DTileset

305 views
Skip to first unread message

mholt...@gmail.com

unread,
Dec 12, 2018, 7:07:53 AM12/12/18
to cesium-dev
It is possible to enable and disable the "show" value of a 3DTileset and dispaly just the desired Tilesets. Is it possible in the same way to enable and disable the children of a tileset with a "show" value? Found only "_visible" in a child Tile but its considered as immutable and has no effect btw.
Are there any other possibilities to hide a child of a tileset?
(Cesium 1.52.0)

mholt...@gmail.com

unread,
Dec 13, 2018, 4:30:44 AM12/13/18
to cesium-dev
Or perhaps a better question : is there a way to change the style of several children in a 3DTileset? Each child may be applied to another style.

mholt...@gmail.com

unread,
Dec 14, 2018, 8:57:57 AM12/14/18
to cesium-dev
On Thursday, December 13, 2018 at 10:30:44 AM UTC+1, mholt...@gmail.com wrote:
> Or perhaps a better question : is there a way to change the style of several children in a 3DTileset? Each child may be applied to another style.

Maybe setting the opacity to zero of a selected 3DTile but not affecting the whole 3DTileset?

Omar Shehata

unread,
Dec 17, 2018, 12:06:09 PM12/17/18
to cesium-dev
I don't think there's an easy way to do that right now. If the children have specific ID's you can create a style on the tileset that sets a certain color (or opacity 0) to those tiles with that ID. 

Another way might be to create them as multiple tilesets instead of one tileset, that way you can selectivity hide and show each one. Would that work for you?

One more way I can think of, that's a bit more of a hack, is if you know what kind of content is in your tileset, you could reach into it and do what you need manually. This GitHub issue links to a Sandcastle that clamps individual tiles to the ground:


You can see how it grabs the associated model in each tile. So you could perhaps set a show property directly on that. 

mholt...@gmail.com

unread,
Dec 18, 2018, 7:21:11 AM12/18/18
to cesium-dev
Thank you. But I think, it's not possible, to create multiple tilesets out of the root tileset, because I cant assign just one clipping plane for all tilesets then. But I need a clipping plane that affects all tilesets. Thats why I created one tileset with the children in it and assigned the clipping plane to the root tileset, which works.

Omar Shehata

unread,
Dec 18, 2018, 4:31:42 PM12/18/18
to cesium-dev
Yeah, you're right. I don't see a good workaround, so I opened a feature request here:


To see what the rest of the team and other community thinks.

Omar Shehata

unread,
Dec 18, 2018, 4:36:37 PM12/18/18
to cesium-dev
If you can describe a bit more about your use case (either here or on the GitHub issue) that'll help get support for this as well. For example, is this just for debugging purposes or is your 3D Tileset split up in a way that each child tile represents a unit of data?

mholt...@gmail.com

unread,
Jan 3, 2019, 4:01:42 AM1/3/19
to cesium-dev
Thank you.
We have 3D models of an underground layers. Each tile represents one layer and they are collected in a root tileset. Through a navigation we want to activate or deactivate only individual layers. Did a workaround and moved the Arary from the Primitives into a temporary container if the user deselects a layer and moves it back into the Primitives when the user selects the layer to be visible.
I don't know if your proposed solution works for me (Transparent Style) beacuse i cannot change the style of a single style by selection, as far as i can see.

mholt...@gmail.com

unread,
Jan 3, 2019, 4:13:51 AM1/3/19
to cesium-dev
And the problem is: our tiles are generated with QGIS, transformed with Blender and into glb and with 3d-tiles-tools into b3dm, so our tiles dont have any features to work with.

Omar Shehata

unread,
Jan 9, 2019, 12:28:13 PM1/9/19
to cesium-dev
I think in this case it might make sense to have each layer as a separate tileset, that way they can be individually controlled. Would that work for you?

Omar Shehata

unread,
Jan 9, 2019, 12:29:40 PM1/9/19
to cesium-dev
Another workaround posted by Matt in the GitHub issue is to set the color on the individual tile, see his example in the comment following that:

mholt...@gmail.com

unread,
Jan 15, 2019, 9:28:01 AM1/15/19
to cesium-dev
An individial controlling of each layer within a tilest would be perfect, sure.
I've looked at the example you linked above. But with the code:
tileset.tileLoad.addEventListener(function(tile) {
tile.color = Cesium.Color.TRANSPARENT;
});
still every sub-tile is set transparent. Can I address only several selected sub-tiles in the same way?

Omar Shehata

unread,
Jan 15, 2019, 3:11:24 PM1/15/19
to cesium-dev
Yes, you'd just need a way to identify which tiles you want to set as transparent. I'm not sure how your tiles are organized, but a simple/naive way would be to collect them all in an array:

var arrayOfTiles = [];

tileset
.tileLoad.
addEventListener(function(tile) {
 arrayOfTiles.push(tile);
});

And then sometime later, on mouse click, or button, or something, you can hide a specific tile:

// Hide the 3rd tile in the array
arrayOfTiles
[2]
.color = Cesium.Color.TRANSPARENT;

mholt...@gmail.com

unread,
Jan 16, 2019, 2:42:45 AM1/16/19
to cesium-dev
I will try that and come back to this post later. Thank you so far!

mholt...@gmail.com

unread,
Feb 11, 2019, 2:47:06 AM2/11/19
to cesium-dev
Unfortunately, this can not work because I have a tileset for a certain region, in which further tilesets (which then map a layer) are included. So I do not have access to the individual sub-tiles loaded by the root tileset with functions or properties provided by CesiumJS. I have to look for another workaround, but thanks!
Reply all
Reply to author
Forward
0 new messages