Hi, I was trying to get this effect to work based on this Topic How to make neural network effect? I’m creating the positions this way:
for ( let i = 0; i < maxParticleCount; i ++ ) {
const x = Math.random() * r - r / 2
const y = Math.random() * r - r / 2
const z = Math.random() * r - r / 2
particlePositions[i * 3] = x
particlePositions[i * 3 + 1] = y
particlePositions[i * 3 + 2] = z
const v = new THREE.Vector3()
particlesData.push({ velocity: v.normalize().randomDirection().divideScalar(2), numConnections: 0 })
}
and updating them like this
for ( let i = 0; i < particleCount; i ++ ) {
// get the particle
const particleData = particlesData[ i ];
const newV = v.set(particlePositions[i * 3], particlePositions[i * 3 + 1], particlePositions[i * 3 + 2]).clone()
newV.add(particleData.velocity).setLength(500)
particlePositions[i * 3] = newV.x
particlePositions[i * 3 + 1] = newV.y
particlePositions[i * 3 + 2] = newV.z
I can’t figure out why the particle speeds progressively decrease! Thanks!