Stalight Starbright



In this topic @Wingnut asked

But… WHAT IF… ANY mesh shape can be an emitter

Here is a step to step approach to trying to answer that question.

  1. Create a complex mesh shape Babylon.js Playground

  2. Add a function that calculates interior points of the mesh and then fill it with spheres for example,

  3. Make the spheres with SPS, add color and wobble them about a bit

  4. Return to the original question and emit particles based on the mesh shape BEWARE there is something wrong in my code. To rerun you MUST refresh the BROWSER. Clicking on RUN seems to add particles and so points[] tries to find an entry in the array larger than the number in the array. Perhaps someone can find my error!

4 PG corrected


Woot! This is really cool! I love it


Wondering if this should be mentioned in the doc actually


It is my intention to add the createInnerPoints function to the utilities sub-section of the snippets section probably just with the first PG. Any insight into the not being able to use the RUN would be welcomed.


This is probably because you cannot reuse as the value will keep incrementing (It is not the particle index in the array unfortunately but a unique number: Babylon.js/babylon.particle.ts at master · BabylonJS/Babylon.js · GitHub)


Note to self - stop making assumptions :woozy_face:


that is so nice


Hey @Dad72… here I needed the “agree” button, so I could agree with Naz. So, thats:

Like (old forum)
Thanks (old)
Laugh (old)
Confused (old)
Sad (old) (rarely used)
Agree (new button)

That’s a lot of data to store. :slight_smile:

But yeah, johnK… fabulous demos, THANK YOU! That’s VERY kind of you to remember, and follow-up-on one of my future-hopes. Well done! (hug) You have opened some very large and pretty doors.