augmented-reality - 如何在第 8 面墙中为粒子系统添加自定义纹理图像?
问题描述
我正在研究第 8 个墙粒子系统(https://www.8thwall.com/8thwall/fireworks-aframe),我想添加自定义纹理而不是默认的“star2.png”。我在资产下创建了一个“图像”文件夹并尝试引用它,但它不起作用。
对上述内容的任何帮助/建议都会很棒!
解决方案
尝试在 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
})
推荐阅读
- python - 如何从单个目录中读取多个 csv 文件并在 Python 中分别绘制它们?
- c++ - 删除后访问指针
- oracle - 在 Oracle 18 的另一个临时表中使用临时表
- r - 使用 grepl 对包含两列中某些文本的相同提及的数据框进行子集化
- python - 提取数据json python
- nativescript - NativeScript Vue 模式中的 navigateTo 问题
- html - 始终保持背景图像在 div 顶部对齐,同时避免文本重叠
- python - TensorFlow Dataset API 不使用 GPU
- r - 如何编写 R 函数以根据两个现有列的条件值在任何数据框中创建新列?
- html - 如何通过以太网在片段中发送超过 1500 字节的 HTML 代码?