# Neural network effect particles speed

**URL:** <https://discourse.threejs.org/t/neural-network-effect-particles-speed/85449>\
**Category:** Questions\
**Tags:** animation\
**Created:** [July 24, 2025, 9:03am UTC](https://discourse.threejs.org/t/neural-network-effect-particles-speed/85449 "2025-07-24T09:03:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca\_Ponzanelli](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/luca_ponzanelli/32/55317_2.png) [@Luca\_Ponzanelli](https://discourse.threejs.org/u/Luca_Ponzanelli)\
**Post date:** [July 24, 2025, 9:03am UTC](https://discourse.threejs.org/t/neural-network-effect-particles-speed/85449/1 "2025-07-24T09:03:57Z")

</div>

Hi, I was trying to get this effect to work based on this Topic [How to make neural network effect?](https://discourse.threejs.org/t/how-to-make-neural-network-effect/49172) I’m creating the positions this way:

```javascript
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

```javascript
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!

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [July 24, 2025, 12:11pm UTC](https://discourse.threejs.org/t/neural-network-effect-particles-speed/85449/2 "2025-07-24T12:11:03Z")

</div>

> [@Luca\_Ponzanelli](#):
>
> I can’t figure out why the particle speeds progressively decrease!

Without knowing what else you do in the code, my hypothesis is that the velocity is fixed, and with every step the direction of the vector to the point gets closer with the direction of the velocity of the point … and this is seen as slowing down. When the vectors are in the same direction, motion will stop.

In the image below, red arrows is constant velocity, P1, P2, P3, are a sequence of movement of one point. The more the point moves, the shorter the move it. As I said, this might be _a reason_ for slowing, but there is no guarantee this is _the reason_ for slowing.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/1/4156f06f1b76cf646ddbb468be4889a6699990e4.png)
