I am new in cesium .
I want to make an effect of a model being flooded.In my consider,first calculate a result which is a terrain data of the model region.and then show a transparent picture with the terrain data or render the terrain data by blue color ,so that it looks like a flood .
now I have a test terrain data ,how can i do the things.
thanks very much !
To shade the terrain, take a look at Globe Materials.
If you want to show the surface of the water, depending on the scale, you can use a rectangle or ellipsoid entity.
If you need to process and host your terrain data, take a look at Cesium ion.
I’m experiencing the same theme (floods) in a new project.
There are multiple solutions to display this kind of event, but everything depends on your datasets source and on what you want to visualize, just the water layer or more detailed information about the floods?
Anyway, I here is my workflow, it is a little bit complex, but you could adjust it for your scope:
- Water: Raster image Geotiff - Elevation grid: it describes the heights of the water in different area of the city, it is the result of a engineering simulation software
- Buildings: Vector Shapefile - Footprints + extra attribute for the height of each building or DSM - Digital Surface Model
Process the water dataset:
- Convert the raster to point cloud format (las - there are different software) and import it in CloudCompare software
- Create the mesh from the point cloud with the Delaunay algorithm inside Cloud Compare
- Export to OBJ format and check the pivot position (it is easier if the pivot is located at axes origin)
- Convert OBJ file to GLTF with the online converter
- Load the GLTF file into Cesium setting the pivot coordinates
Process the building dataset:
For what concerns the 3D building I have tested 2 solutions:
- The first one is to create a 3d model of the city through the extrusion of the single shapes (this could be done in several ways), and import into cesium as a GLTF model or as 3DTiles (this step is working in progress)
- The second on is to import the DSM in Cesium ION and merge it with the Cesium Terrain
DSM on Cesium ION
Hope this could help you!
Here’s a relatively straightforward sandcastle example that may be helpful to you. I used an extruded translucent blue polygon to represent the “water” to cover the state of Colorado. Hope it can be useful in some way c:
Is it possible to show a mesh instead of a horizontal polygon? If i had an additional terrain mesh that representing a protective surface for aviation and tiled it up to .terrain files, could i then show this mesh in the same way as the water?
You could combine two terrain sources while tiling, but I don’t think CesiumJS supports multiple terrain providers and positioning them separately like that.
This sounds like an interesting use case though, feel free to open another thread and we might get some ideas on implementing this particular effect.