zoukankan      html  css  js  c++  java
  • vue中cesium添加实例模型

    let fanModel = {
         uri: 'model3D/fan.glb', // glb实例模型
         height: 85,
         scaling: 160.05,
         heading: 90,
         pitch: 90,
         roll: 0
      }
    let position = Cesium.Cartesian3.fromDegrees(longitude, latitude, fanModel.height)
    let fanEntity = new Cesium.Entity({
          id: 'fan' + fan.fanId,
          show: true,
          position: position,
          orientation: Cesium.Transforms.headingPitchRollQuaternion(
              position,
              new Cesium.HeadingPitchRoll(
                Cesium.Math.toRadians(fanModel.heading), // heading 船首向
                Cesium.Math.toRadians(fanModel.pitch), // pitch   左右翻转
                Cesium.Math.toRadians(fanModel.roll) // roll     前后翻转
              )
           ),
           model: {
              uri: fanModel.uri,
              scale: fanModel.scaling,
              runAnimations: true,
              color: Cesium.Color.RED
           },
           label: {
              pixelOffset: new Cesium.Cartesian2(0, -20),
              showBackground: true,
              backgroundColor: new Cesium.Color(0.165, 0.165, 0.165, 0.2),
              scale: 0.6,
              font: '24px SourceHanSansSC-Medium',
              fillColor: fengjiColor,
              text: labelText
            }
        })
     
      this.viewer.entities.add(fanEntity)
  • 相关阅读:
    SPI简述
    stm32和sd卡
    BKP和RTC
    Lwip与底层的接口
    关于Ad-hoc
    stm32 引脚映射 和 ADC
    GDB使用总结
    linux管道和重定向
    学习python的第四天
    学习pyton的第三天
  • 原文地址:https://www.cnblogs.com/hlweng-0207/p/11912212.html
Copyright © 2011-2022 走看看