In the sandcastle example above, it seems that colors were given according to the value of ${id}, and if I change ${id} to height, my point cloud data can be displayed as color by height.
But, I can’t find where the id value in the sandcastle example data or the height value in my point cloud data is.
So my question is how can I access the height value in 3d tiles data?
First is that it’s not a given that a point cloud has a height property, it really depends if the pointcloud was tiled with that property in it. The reason is because all points/tiles are in Cartesian3 coordinate system (each point is a 3D vector distance from the center of the earth) out of the box, not in world coordinates (lat, long, height), so you have to add them (especially the Height property) when you create your pointcloud (with whatever tool you use for it; I don’t know which models in Cesium Ion have what).
Secondly, you can’t test for what properties the pointcloud has upfront (at least not in the current Cesium), so the rendering either breaks (if the property isn’t there), or you have to write a rule that checks for it (first rule);
If you know it’s got height there’s no issue. I’ve tried a number of tricks with meta variables and all sorts of detection, but this one is a bit tricky. It also doesn’t help that the engine for pointclouds is slightly different than rendering other 3D tilesets (and some brain-cells in the back of the head informs me that I can’t check for ‘undefined’ in pointclouds, only in other 3D tiles, but I might be misremembering).
This is true because styling for point clouds is evaluated in the GPU via a shader vs styling for 3D buildings for example is done by evaluated on the CPU.
Thanks for linking to the Styling & Filtering article Alex! The style pointclouds section in particular has a link to a Sandcastle that shows you how to styling using the absolute position of a point if you created your point cloud with Cesium ion. See the heatmap Sandcastle.