首页 > 解决方案 > 如何在第 8 面墙中为粒子系统添加自定义纹理图像?

问题描述

我正在研究第 8 个墙粒子系统(https://www.8thwall.com/8thwall/fireworks-aframe),我想添加自定义纹理而不是默认的“star2.png”。我在资产下创建了一个“图像”文件夹并尝试引用它,但它不起作用。

对上述内容的任何帮助/建议都会很棒!

标签: augmented-realityparticle-systemwebxr8thwall-xr8thwall-web

解决方案


尝试在 Rocket.js 文件中的“粒子系统”组件中添加“纹理”参数,并将资产的相对路径包装在 require() 中

https://www.8thwall.com/8thwall/fireworks-aframe/master/rocket.js#L41为例:

rocketParticles.setAttribute('particle-system', {
  texture: require('./assets/images/myfile.png'),
  // rest of the params go here
})

推荐阅读