I got a little problem with my visualization program.
I find a great code of visualizing the PSO algorithm in 2D. And I tried to change it into 3D.I've done the majority part of it, but now the particles just don't update, they superpose over the old ones.

[Figure shows like this](https://preview.redd.it/fhiagfvecnr81.png?width=1102&amp;format=png&amp;auto=webp&amp;s=6ed3c223f26d9407aecc242b2facc2e23458e16f)

&amp;#x200B;

Here is the code link：

[https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5](https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5)