Jump to content

Search the Community

Showing results for tags 'sps digest'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 1 result

  1. Hi folks, Well, it's not yet a feature (soon), neither a complete demo, neither a project. It's probably an upcoming feature. As you know, you can populate so far a SPS with some mesh models with the method sps.addShape(model, number). This means that you create number particles with the shape of the mesh model. Soon, you will have also the ability to build a SPS from a given mesh. This means, the SPS will digest the mesh, decompose it in many particles under the hood and set them at the same location that the original mesh facets. Example (click on the mesh to blow it -did you notice that I liked to blow things up ?-): http://www.babylonjs-playground.com/#YCEMR#1 Here, you've got a box that my SPS digests at the line 153 (don't care about the rest of the code for now) : sps.digest(model, {}); The box is digested and the SPS will then have as many triangular particles than the original box facets. If you want each particle to be composed by more than one mesh facet (for big meshes for example), you can specify it with the parameter facetNb: sps.digest(model, {facetNb: 2}); This means each particle is now built by 2 mesh facets, so in our former example with quads instead of triangles : http://www.babylonjs-playground.com/#YCEMR#2 Obviously this works (or should) with any mesh type : http://www.babylonjs-playground.com/#YCEMR#3 the same with particles sized to 64 facets : http://www.babylonjs-playground.com/#YCEMR#4 Torus knot ? baoomm : http://www.babylonjs-playground.com/#YCEMR#5 Maybe the number of facets per particle doesn't make much sense to you and you would prefer to define the number of particles instead. This is possible, just use the parameter number: sps.digest(model, {number: 20}); This will decompose the whole into almost 20 (20 or 21) particles depending on the initial number of the mesh facets. line 152 : http://www.babylonjs-playground.com/#YCEMR#6 Does it work with imported meshes also ? yes, sir (beware, this is CPU intensive and I noticed that the PG has side effects on the perfs because it runs faster off the PG) : http://www.babylonjs-playground.com/#YCEMR#7 no idea of an URL CORS friendly to download the Dude in the PG. http://www.babylonjs-playground.com/#YCEMR#10 Is this compatible with the addShape() method ? yes, sir : take a look at the line 153 here : http://www.babylonjs-playground.com/#YCEMR#8 First, I add one box particle, then I digest a box mesh (quads), then I re-add a box particle. My SPS should then have : 2 box particles and 6 quad particles, ok ? Set the cam beneath the box and blow it towards the sky, you will see the quad particles and 2 boxes falling back to the ground. Right, now you know how this work (or should work). But what is this for ? It could be used to build easily a SPS from any mesh as I explained. Then you can, at the particle level (the one you chose : facer, several facets, a tenth of the mesh, a third of the mesh, half of the mesh, etc), morph the mesh, distord it, twist it, vaporize it, liquefy it, blow it, etc [EDIT] I really need to blow a spherical harmonic ribbon, just for fun ! [EDIT 2] oh, and I forgot to say you can digest several meshes in the SPS or even the same mesh several times : http://www.babylonjs-playground.com/#YCEMR#9 line 153 : torus knot digested twice with different particle numbers
  • Create New...