Is it possible to add an image as texture on a 3D Tileset object?
Maybe something like the app is running, the objects of the tileset are visible and the user can turn a checkbox on to see a predefined image rendered right on the Tileset?
Is it possible to add an image as texture on a 3D Tileset object?
Maybe something like the app is running, the objects of the tileset are visible and the user can turn a checkbox on to see a predefined image rendered right on the Tileset?
Yes! Check out the classification types code example:
https://sandcastle.cesium.com/index.html?src=Classification%20Types.html
Select “Textured Material” in the second drop down.
This is a first good start.
Defined the polygon via
let polygon = viewer.entities.add({
polygon : {
hierarchy : new PolygonHierarchy(Cartesian3.fromDegreesArray([13, 53, 14, 53, 14, 52, 13, 52])),
material : Color.RED.withAlpha(0.5),
classificationType : ClassificationType.CESIUM_3D_TILE
}
});
and added the picture to the material of the polygon:
polygon.polygon.material = ‘…/images/pic.jpg’;
Unfortunately some parts of the tileset are not covered by the image (as shown in the screenshot).
What may be the cause for this “holes” in the Material and is it possible to assign the polygon a specific tileset, that may lay above or under another tileset (like geological layer)?