I would like to change the transparency of a Cesium3DTileset. For single tiles I managed this via the alpha value in color, but how does it work for the whole tileset? The style function does not change anything for me:
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : './resources/3dtiles/tileset'
}));
tileset.style = new Cesium.Cesium3DTileStyle({
alpha: 0.2
});
Many thanks,
Jörn
Hi Jörn,
Cesium’s 3D Tiles’ style has only a very limited set of options in terms of appearance (show and color, as far as I know). So to change your the transparency your only option is to decide a color and set the alpha value along with it. For example:
var myStyle = new Cesium.Cesium3DTileStyle({
color : “color(’#FFFFFF’, 0.2)”, //white, alpha = 0.2
show : true
});
tileset.style = myStyle;
``
For more details, you can refer to this:
https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/Styling
Hope that helps!
-victor
Hi Victor,
Thanks for your support.
I have noticed that the Showcase Example "3D Tiles Feature Picking" accepts the style without any problems.
https://cesiumjs.org/Cesium/Apps/Sandcastle/gallery/3D%20Tiles%20Feature%20Picking.html
With the showcase "3D Tiles Photogrammetry" I can't affect the styling.
https://cesiumjs.org/Cesium/Apps/Sandcastle/gallery/3D%20Tiles%20Photogrammetry.html
Are there differences between these two 3D tiles that prevent styling changes?
Jörn
Hi Jörn,
Glad to be of help.
Are you referring to this example:
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Apps/Sandcastle/gallery/3D%20Tiles%20Feature%20Picking.html
If so I do not see anything related to styling of the 3D Tiles. May be you can point out which line for me? I have also added your code (with the alpha field) to give it a try and the tiles didn’t turn transparent.
-victor
The photogrametry tileset don’t have any meta data (or under the hood, a feature table) to style.
If you do want to style a photogrametry tileset, take a look at classification.
Thanks,
Gabby
Correction: no Batch Table.