Mars3d实现汽车尾气粒子效果从汽车屁股开始发射效果

本身的汽车尾气粒子效果:在汽车模型的中间发射的↓↓↓↓↓↓↓↓↓↓↓

Mars3d实例中是使用transY偏移值实现汽车尾气粒子效果从汽车屁股开始发射效果:

复制代码
// 动态运行车辆的尾气粒子效果
function addDemoGraphic4(graphicLayer) {
  const fixedRoute = new mars3d.graphic.FixedRoute({
    speed: 120,
    positions: [
      [117.226585, 31.818437, 32.41],
      [117.226838, 31.811681, 28.23]
    ],
    clockLoop: true, // 是否循环播放
    model: {
      url: "//data.mars3d.cn/gltf/mars/qiche.gltf",
      scale: 0.2
    }
  })
  graphicLayer.addGraphic(fixedRoute)

  fixedRoute.start() // 启动漫游

  const particleSystem = new mars3d.graphic.ParticleSystem({
    position: fixedRoute.property,
    style: {
      image: "./img/particle/smoke.png",
      particleSize: 12, // 粒子大小(单位:像素)
      emissionRate: 20.0, // 发射速率 (单位:次/秒)
      pitch: 40, // 俯仰角
      // gravity: -1, // 重力因子,会修改速度矢量以改变方向或速度(基于物理的效果)
      transY: 8.0, // 偏移值Y,尾气在车辆后面一些
      maxHeight: 1000, // 超出该高度后不显示粒子效果

      startColor: Cesium.Color.GREY.withAlpha(0.7), // 开始颜色
      endColor: Cesium.Color.WHITE.withAlpha(0.0), // 结束颜色
      startScale: 1.0, //  开始比例(单位:相对于imageSize大小的倍数)
      endScale: 5.0, // 结束比例(单位:相对于imageSize大小的倍数)
      minimumSpeed: 1.0, // 最小速度(米/秒)
      maximumSpeed: 4.0 // 最大速度(米/秒)
    },
    attr: { remark: "车辆尾气" }
  })
  graphicLayer.addGraphic(particleSystem)
}

示例链接:功能示例(Vue版) | Mars3D三维可视化平台 | 火星科技

相关效果:

粒子本身的参数emitterModelMatrix也可以实现从车屁股开始发射效果:

复制代码
// 动态运行车辆的尾气粒子效果
function addDemoGraphic4(graphicLayer) {
  const fixedRoute = new mars3d.graphic.FixedRoute({
    speed: 120,
    positions: [
      [117.226585, 31.818437, 32.41],
      [117.226838, 31.811681, 28.23]
    ],
    clockLoop: true, // 是否循环播放
    model: {
      url: "//data.mars3d.cn/gltf/mars/qiche.gltf",
      scale: 0.2
    },
      attr: { remark: "车辆尾气emitterModelMatrix实现" }
  })
  graphicLayer.addGraphic(fixedRoute)

  fixedRoute.start() // 启动漫游

  const particleSystem = new mars3d.graphic.ParticleSystem({
    position: fixedRoute.property,
    emitterModelMatrix: Cesium.Matrix4.fromTranslation( new Cesium.Cartesian3(0, 15, 0)),
    style: {
      image: "./img/particle/smoke.png",
      particleSize: 12, // 粒子大小(单位:像素)
      emissionRate: 20.0, // 发射速率 (单位:次/秒)
      pitch: 40, 
      maxHeight: 1000, // 超出该高度后不显示粒子效果
      startColor: Cesium.Color.GREY.withAlpha(0.7), // 开始颜色
      endColor: Cesium.Color.WHITE.withAlpha(0.0), // 结束颜色
      startScale: 1.0, //  开始比例(单位:相对于imageSize大小的倍数)
      endScale: 5.0, // 结束比例(单位:相对于imageSize大小的倍数)
      minimumSpeed: 1.0, // 最小速度(米/秒)
      maximumSpeed: 4.0 // 最大速度(米/秒)
    },
    attr: { remark: "车辆尾气" }
  })
  graphicLayer.addGraphic(particleSystem)
}
相关推荐
奕鼎竜瑆2 小时前
Solid 前端响应式开发从零到精通
前端·人工智能
动恰客流统计3 小时前
景区客流统计怎么做?兼顾管控与运营的实施方案解析
大数据·前端·人工智能
派小心.4 小时前
A/B测试工具免费版够用吗?
前端·数据分析
制冷技术咨询与服务4 小时前
新能源汽车线束的漏水问题
汽车·新能源汽车线束
前端snow4 小时前
ai agent --- redis 缓存
前端
杨福宇5 小时前
100BASE T1以太网实时控制的危机V3.21 ——辅助自动驾驶难达标
网络·网络协议·安全·自动驾驶·汽车
duanshu_5 小时前
官网表单与下载异常怎么排查?五个环节定位故障
前端·自动化·flyweight
Zhou1411365 小时前
SpringBoot_03_Web开发
前端·spring boot·python
辻弋2015 小时前
【无标题】
大数据·服务器·前端·搜索引擎·开源软件
FluxArt6 小时前
GPT Image 2.5 中文提示词教程:Flux Art 可复用模板
前端·gpt·算法