全球等高线忽略小于0的高度

This commit is contained in:
zh
2025-07-14 09:27:46 +08:00
parent c843b025fc
commit 2db5eafabf
2 changed files with 10 additions and 3 deletions

View File

@ -111,7 +111,7 @@ async function dialog(sdk) {
if (e.target.checked) {
show = true
let height = sdk.viewer.camera.positionCartographic.height
if(height>16360) {
if (height > 16360) {
let cartographic = sdk.viewer.camera.positionCartographic
let options = {
position: {
@ -413,6 +413,9 @@ function showContour(sdk) {
let gap = pos84.alt - mainContourHeight
let gap2 = material.uniforms.spacing / (material.uniforms.secondaryLinesCount + 1)
let activeHeight = Math.floor(gap / gap2) * gap2 + mainContourHeight
if (pos84.alt < 0) {
pos84.alt = 0
}
if ((pos84.alt - activeHeight) > gap2 / 2) {
activeHeight = activeHeight + gap2
}
@ -581,6 +584,10 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
outColor = vec4(0.0);
}
if(materialInput.height<0.0) {
outColor = vec4(0.0);
}
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;