Cesium实现视频影像融合

2021-04-21  本文已影响0人  韩无仙

视频影像融合

cesium中可以将video标签作为材质赋予实体,实体贴地后会覆盖模型表面,达到视频影像融合的效果。
html video标签所支持的视频文件编码格式如下

<video ref="video" autoplay loop crossorigin controls style="display: none">
      <source
        src="https://cesium.com/public/SandcastleSampleData/big-buck-bunny_trailer.mp4"
        type="video/mp4"
      />
    </video>
addVideo() {
      let videoElement = this.$refs.video;
      this.viewer.showRenderLoopErrors = false;
      this.viewer.shouldAnimate = true;
      this.viewer.entities.add({
        polygon: {
          hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([
            113.2321,
            23.1172,
            5,
            113.2315,
            23.1172,
            5,
            113.2315,
            23.1178,
            5,
            113.2321,
            23.1178,
            5,
          ]),
          material: videoElement, // 将材质设置为video元素
          clampToGround: true,
        },
      });
    },

展示效果:


image.png

全景摄像头数据接入

上一篇 下一篇

猜你喜欢

热点阅读