Jump to content

Selecting Particles?


JayMa
 Share

Recommended Posts

Hi there,

 

I'm relatively new to the Babylon library, but trying to pick it up with a web experiment. That being said, I'm trying to see if it's possible to select individual particles from a particle system? I've searched everywhere, and the action manager that appears is correlated with 'meshes', which I assume particles are not? 

 

From digging into the console.log, I do know each particle has a unique identifier. That's what I want to retrieve, but I'm not quite sure how to begin. Could someone point me in the right direction?

Link to comment
Share on other sites

Hi JayMa and welcome to the forum!

 

Do you already know the BJS playground: http://www.babylonjs-playground.com/#1K0NSN ?

 

In this example it prints the current particles in the particle system after waiting for 1 second. Maybe that's already what you want? But I guess it depends on what you want to do with those particles. So not sure if just getting them like that is enough for you.

 

There's also quite a bit of documentation here: http://doc.babylonjs.com/page.php?p=22121 (maybe the part "Custom functions" is intersting for you?)

 

If you tell us more of what you want to achieve in the end we might be able to help you more. Try setting up a playground yourself to show us your current problem so that people can try things out and show you how to do stuff.

 

I hope that helps. Good luck and don't forget to show us what you created ... whatever it is ;)

Link to comment
Share on other sites

Hi JayMa, welcome to the forum, good to have you with us!

 

Umm... first...

 

 

the action manager that appears is correlated with 'meshes', which I assume particles are not?

 

Correct.  The way our standard and SPS particle systems are designed... ALL the particles make up a single mesh... as far as I know.  It is not too difficult to make a particleSystem that uses a separate standard BJS basic shape for each particle, but particle performance will suffer substantially.

 

JayMa... when you say "select", do you mean... like... with a mouse click?  (Around here, that's called "picking").

 

Lately, Jerome and friends have been hard-positioning buildings-shaped particles on grounds and heightMaps.  So, MAYBE... you are asking how to select a single building of Jerome's particle-city... with a mouse click (a pick).

 

Is that what you want to do?  Select (pick) a particle with a mouse click?  

 

If so, I don't know if that is possible, but it's a darned good question, and the experts are nearby.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...