I am using Cesium 1.35 on linux, with Firefox.
I am interested to visualise point clouds by the point distance to another object, like a landmark, or vector line. The Cesium Sandcastle Gallery example called “3D Tiles Feature Styling” has a function colorByDistance which allows to colour by distance from landmark, for which the snipit is shown below.
Questions:
1 does anyone know the format and how it works, because the point with latitude longitude -1.291777521, 0.7105706624 is not relevant in absolute values to the example of Manhattan. Perhaps it is relative to an origin?
2 does anyone have any idea if it possible to take that further and use the function colorByDistance for not just a point , but at vector polyline. Eg a corridor type analysis
3 will this work for point cloud, as opposed to 3D tile?
// Color buildings by distance from a landmark.
function colorByDistance() {
tileset.style = new Cesium.Cesium3DTileStyle({
defines : {
distance : "distance(vec2(${longitude}, ${latitude}), vec2(-1.291777521, 0.7105706624))"
},
color : {
conditions : [
["${distance} > 0.0002", "color('gray')"],
["true", "mix(color('yellow'), color('green'), ${distance} / 0.0002)"]
]
}
});
}