当前位置: 首页 > article >正文

根据状态修改圆锥扩散材质并实现扩散效果【Mars3d】

相关链接:

http://mars3d.cn/editor-vue.html?key=ex_6_3_3&id=graphic/entity/cylinder

相关代码:

function addDemoGraphic1(graphicLayer) {
  const point = new mars3d.LngLatPoint(116.504297, 30.924326, 9000)

  // 添加模型
  const graphicModel = new mars3d.graphic.ModelEntity({
    position: point,
    style: {
      url: "//data.mars3d.cn/gltf/mars/feiji.glb",
      scale: 1,
      minimumPixelSize: 50
    },
    attr: { remark: "示例6" }
  })
  graphicLayer.addGraphic(graphicModel)

  // 效果1
  const pointQY = point.clone()
  pointQY.alt = pointQY.alt / 2

  const graphic = new mars3d.graphic.CylinderEntity({
    position: pointQY,
    id: "bobo",
    style: {
      length: point.alt,
      topRadius: 0.0,
      bottomRadius: 2000,
      materialType: mars3d.MaterialType.CircleWave,
      materialOptions: {
        color: "#ffff00",
        repeat: 30.0,
        thickness: 0.2
      }
    }
  })
  graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)

  setTimeout(() => {
    const cc = graphicLayer.getGraphicById("bobo")
    cc.setStyle({
      materialType: mars3d.MaterialType.CylinderWave,
      materialOptions: {
        color: "#ffff00",
        repeat: 30.0,
        thickness: 0.2
      }
    })
  }, 6000)
}


http://www.kler.cn/a/472043.html

相关文章:

  • 百度Android面试题及参考答案 (下)
  • unity学习14:unity里的C#脚本的几个基本生命周期方法, 脚本次序order等
  • 使用 Conda创建新的环境遇到的问题
  • Vue3 + Vite + Electron + Ts 项目快速创建
  • 基于python的网络爬虫爬取天气数据及可视化分析(Matplotlib、sk-learn等,包括ppt,视频)
  • [项目实战2]贪吃蛇游戏
  • linux下绑host
  • jenkins入门13--pipeline
  • 单片机串口控制
  • docker优雅停止容器
  • Linux中rsync命令使用
  • Android布局layout的draw简洁clipPath实现圆角矩形布局,Kotlin
  • 『SQLite』如何使用索引来查询数据?
  • matlab编写Newton插值多项式
  • 旷视科技C++面试题及参考答案
  • 关于FPGA中添加FIR IP核(采用了GOWIN EDA)
  • 使用宝塔面板,安装 Nginx、MySQL 和 Node.js
  • 后端Java开发:第十天
  • 【Linux】进程概念(PCB)与进程创建(fork)
  • 策略模式(Stragety Pattern)