1. 粒子球
// 创建几何体
const sphereGeometry = new THREE.SphereGeometry(3,20,20)
// 设置点材质
const pointsMaterial = new THREE.PointsMaterial();
pointsMaterial.size = 0.2;
pointsMaterial.color.set("#ff0000")
pointsMaterial.sizeAttenuation = true
// 载入纹理
const textureLoader = new THREE.TextureLoader();
const texture = textureLoader.load("/particles/1.png")
// 设置点纹理
pointsMaterial.map = texture;
pointsMaterial.alphaMap = texture;
pointsMaterial.transparent = true;
// 深度检测
pointsMaterial.depthWrite = false;
// 混合算法
pointsMaterial.blending = THREE.AdditiveBlending;
const points = new THREE.Points(sphereGeometry,pointsMaterial);
scene.add(points)