数字乡村-万田村效果分析

image.png

旋转效果+数字沙盘

旋转

20210924_175210-0-6.gif

旋转采用的方法是实时改变相机视角,相机视角计算方法采用

var heading = Cesium.Math.toRadians(delTime * angle) + initialHeading;
var pitch = Cesium.Math.toRadians(-30);
var angle = 360 / 60;

设置视角方法

viewer.scene.camera.setView({
    destination :position, // 点的坐标
    orientation:{
        heading: heading,
        pitch : pitch,
    }
});
viewer.scene.camera.moveBackward(distance);

数字沙盘

沙盘采用墙体绘制即可,首先绘制出模型轮廓面(geojson),如果建模时通过kml指定了模型范围的话也可以直接解析kml文件得到轮廓面。

Wall = viewer.entities.add({
                  name: "mywall",
                  wall: {
                    positions: Cesium.Cartesian3.fromDegreesArrayHeights(positions),
                        minimumHeights: wallmins,
                        material: getColorRamp([0.0, 0.05, 0.12, 0.3, 0.5, 0.85, 1.0],true),
                  },
                });

流转土地效果

image.png

该效果主要使用了动态墙体纹理与ClassificationPrimitive类

viewer.scene.primitives.add(
                new Cesium.ClassificationPrimitive({
                    geometryInstances:instances,
                    releaseGeometryInstances:false,
                    asynchronous:false,
                    classificationType: Cesium.ClassificationType.CESIUM_3D_TILE,
                })
            );

农房效果

image.png

同理,使用了ClassificationPrimitive类

道路特效

20210924_181354-0-3.gif

运用了cesium 的 viewer.scene.postProcessStages.bloom

bloom = viewer.scene.postProcessStages.bloom;
bloom.enabled = true;

流动线采用了自定义shader实现的动态纹理

"czm_material czm_getMaterial(czm_materialInput materialInput)\n\
     {\n\
          czm_material material = czm_getDefaultMaterial(materialInput);\n\
          vec2 st = materialInput.st;\n\
          vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\n\
          material.alpha = colorImage.a * color.a;\n\
          material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\
          return material;\n\
      }"

联户od线效果

20210924_181808-0-3.gif
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容