How to change the color of a particle at a particular location

Hello everyone
I need to use to generate a heat map is similar to the effect of

But this is a 2d I need 3d, how should I use Babylon to generate, this effect this is my playground

1 Like

I think I should use particleSystem.updateFunction ?

1 Like

Hello and welcome to the Babylon community! I think updateFunction is a good idea, since you can access the particle position from there.

I tried it in a very simple playground, coloring the particles according to their x,y,z positions. :smiley:


Hi @lingliyi and welcome from me.

This is an example using Solid Particle System

For some reason I have not worked out yet (but @jerome might if has time) there are camera angles that make sections of the map disappear.

I have overcome this by adding three orthagonal planes at each point but this slows the creation of the map down Babylon.js Playground


If you set the billboard to true, you have to call setParticles() each frame so the planar particle rotations are computed according to the camera position
(with less points, because it’s CPU intensive)

other approach : use 3D particles instead of planar ones and don’t rotate them (so no billboarding) each frame


Thank you, knew I was missing something simple.


Thank you. I think the best solution right now is to use updateFunction

1 Like