Can somebody give me a detailed explanation of the below code?
Does it calculate based on earth's curvature also and to what precision?
function colorByDistance() {
tileset.style = new Cesium.Cesium3DTileStyle({
defines : {
distance : "distance(vec2(radians(\{longitude\}\), radians\({latitude})), vec2(-1.291777521, 0.7105706624))"
},
color : {
conditions : [
["\{distance\} > 0\.0012","color\('gray'\)"\],
\["{distance} > 0.0008", "mix(color('yellow'), color('red'), (\{distance\} \- 0\.008\) / 0\.0004\)"\],
\["{distance} > 0.0004", "mix(color('green'), color('yellow'), (\{distance\} \- 0\.0004\) / 0\.0004\)"\],
\["{distance} < 0.00001", "color('white')"],
["true", "mix(color('blue'), color('green'), ${distance} / 0.0004)"]
]
}
});
}
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
4. The Cesium version you're using, your operating system and browser.
1.47, win7, chrome