Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the effect of Underground Mode in Cesium Development

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to achieve underground mode effect in Cesium development". The content is simple and easy to understand and clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "how to achieve underground mode effect in Cesium development".

After modifying the source code, when executing underground mode, set the background color of the map, synchronize the translucent operation of the map image, and refresh the image layer to display the effect in time.// Set map basecolor to transparent

viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0);/ /Cycle to set transparency of image

var _mapAlpha = 0.5;

if (viewer.imageryLayers) {

for (var i = 0; i < viewer.imageryLayers.length; i++) {

viewer.imageryLayers.get(i).alpha = _mapAlpha;

}

}

//Refresh all image slices

viewer.scene.globe._ surface.invalidateAllTiles();

Transparent surface effect, showing half above ground and underground

In the above image, the transparency of underground mode is realized, but there is still a shadow floating underground. This is Cesium's own atmospheric effect. If you need to turn it off, this effect will not exist. viewer.scene.skyAtmosphere.show = false;

There is no problem with black shadows in the above image. The whole scene has turned black. Therefore, when using the map, the dark base image will appear very dark and the specific effect cannot be seen clearly. The above is all the content of this article "How to realize underground mode effect in Cesium development", thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report