Jump to content

Controlling Particles


iiceman
 Share

Recommended Posts

@jerome, right, I saw that you made it with your ribbon mesh. I already check it out but I was still not sure that I understood :P The main thing that confused me was that you use 2 paths. The crazy thing about the Möbius Stripe is that it is actually a surface with only one edge, right? So if I want to use particles that move like they float on such a Möbius Stripe, do I need those 2 functions? or even multiple particle emitters (so that it is not just one line but like an actual 2D twisted surface)? Maybe I just lack the imagination and I figure it out when I try it :P

 

@Temechon, sure, a thread for each question is fine (maybe one for all physics related questions?). I think I start with the first one as soon as I get the time tonight. And yeah, might be one or two physics questions (actually I got 3 on my mind so far :P), I would like to stick with Oimo, works pretty well for me so far.

Link to comment
Share on other sites

No, you don't need two paths.

Each path here is one edge of the ribbon

 

You could so have :

new BABYLON.Vector3( (1 + t * Math.cos(v/2) / 2) * Math.cos(v), (1 + t * Math.cos(v/2) / 2) * Math.sin(v) , t * Math.sin(v/2) / 2 );

making var t vary from -1 to 1 to cover the whole width

 

maybe something like this (if you want, say, 20 vertices on the width, not tested) :

for (var i = 0; i <= 60; i++) {  var v = 2.0 * Math.PI * i / 60;  for(var t = -1; t <= 1; t += 0.1) {   // store your vertices as you want here with the formula above  }}
Link to comment
Share on other sites

Well, actually I didn't really want to achieve anything in particular. Just trying out to see whats possible and how to abuse the particle system. But I think its a bit disturbing that they bounce that randomly, I would like them to form a strip but with fixed positions, like in the latest playground when its still building up. The problem is that as soon as all particles are emitted they start bouncing randomly... I am not sure why though.

Link to comment
Share on other sites

the bouncing effect is due to very short life time

change it to something longer, you'll see them at fixed position ... until they die

        ps.minLifeTime = 60;        ps.maxLifeTime = 60;

maybe you simply don't want mortal particles ?

Link to comment
Share on other sites

Hmm.. good point... maybe I really don't want them to die... http://www.babylonjs-playground.com/#2KOEWJ#5

 

But that here is okay, too: http://www.babylonjs-playground.com/#2KOEWJ#6 ... they die but appear in the same spot again... sooo, I don't care if they live or die  :P

 

New goal.. I want them to move/float like the the strip is rotating...seems like they can't die, otherwise it gets stuck:

http://www.babylonjs-playground.com/#2KOEWJ#7 (get stuck after all particles are initiated)

http://www.babylonjs-playground.com/#2KOEWJ#8 (works well and looks cool)

Link to comment
Share on other sites

hey iiceman

here is your moebius ribbon particle system again : http://www.babylonjs-playground.com/#2KOEWJ#9

I just commented some useless lines of code to get the same final result.

 

this might be insignifiant but I ran it on my old laptop computer and it improved the frame rate from 45 fps to 52 fps

=> +15% just by deleting some code ;-)

 

worth it !

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...