Hello everyone
is it possible to invisible each particle in PCS? I didn’t find anything in the documentation.
I use the following code for do it:
var pcs= new BABYLON.PointsCloudSystem("pcs", 1, scene)
pcs.addPoints(10000);
pcs.buildMeshAsync();
pcs.particles.forEach((particle) => {
particle.isVisible = false;
});
One way I able to do this was setting the entire mesh visibility to 0.
engine.runRenderLoop(() => {
pcs.mesh.visibility = 0;
});
I think there is a better way to set the individual particle (for example if you wanted different particles to be different alphas) Perhaps this line in the documentation helps?
- Changes to particle properties can be achieved with the
initParticles()
or updateParticle(particle)
methods and a call to setParticles
.
1 Like
Thanks a lot , I am going to try it.
I cannot use engine.runRenderLoop(() => { pcs.mesh.visibility = 0; });
because I want to use a check box to show and hide the model
I have solve it, with dispose and then rebuild it again.
Thank you so much for your helping.
Awesome! Glad I could be of help.
1 Like