Spawn MassFX particles on surface w/intersect check


#1

Hello,

I have 2 questions:

The first has to do with spawning MassFX particles with a position offset so they are born near their parent, but far enough away as to avoid an intersection resulting in the particle being repelled away from each other. Some kind of box3 op that moves them a particle diameter length away from the parent on birth? How would you approach this?

My second question is similar, but has to do with a specific application:

I’d like to spawn massFX particles (little spheres) onto the surface geometry (call it a large geosphere)that is animated - scaling up in size. Ideally there would be as many MassFX particles as would ‘fit’ on the surface without intersecting…as the large geosphere surface scales up, and empty space becomes available, new particles would be spawned into those spots. Essentially keeping the surface as ‘packed’ with as many massFX particles as possible.

Any ideas of how one might do this?

Thanks,
Bob Dyce


#2

Hey Robert,

Here’s the answer for your first question:

You’re right a box3 data op will work. You would approach this problem with by finding the Shape Extent which is the distance of the furthest surface point from the pivot of the shape.

To find this surface point you will need a directional vector that is pointing from the pivot out towards the surface. This can be a speed direction (might be good for finding collision point on the surface) or a random direction which is what I used in the image below.

In my example I used a input proxy – shape extent because I always want to be reading the scale/shape of my parent particle. In your amount change make sure you are creating the parent ID channel.

When you know the distance from the pivot to the surface, you can add an offset vector and your pivot/position vector together and move your spawned particles there. You can use a multiplier of the shape extent amount to adjust how they sit.

I can share the scene file but I think its a good exercise to wire everything together yourself. Give it a go let me know if you need more info than that! Goodluck!

fullsize: http://i60.tinypic.com/epgfww.jpg

Edit: If you want to avoid those physx pops/intercollisions the next step would be to delete any spawned particle that is overlapping with another.

You can always incorporate the spawned particles shape extent too and add that into the mix. But for this example a simple offset amount is good enough.

Shape extent rocks, it can be used for displacement, shape collisions without physx, yada yada. Here’s a video of the example in action:

http://tinypic.com/player.php?v=15d8djp>&s=8#.VIksnzGUfTc


#3

Thanks a ton! I’ve got something worked up, but I’m a little unclear on what function you are using where the real value leaves the shape extent and goes into a function called: “Offset_to_Surface_amount” - whats happening in here?

Thanks,
Bob Dyce


#4

no problem! really it’s just one real input, using absolute function. haha there’s really nothing in there I’m just using the result - post factor as a multiplier. In my scene i think I set it to .9 to get them a bit closer to the surface.


#5

Haha…I wondered if that was the case!!

Another question: You have Function called V1-V2_Look_Direction …are you just using straight up subtraction in this operator or vector project or something else?

I am really wishing I would have paid better attention in math class!!

Thanks,
Bob Dyce


#6

Yep it’s just subtraction. Don’t worry I also didn’t learn any of this in math class :frowning: But through the help of other artists :slight_smile:

I’d like to think of it as subtracting your ‘goal’ vector by your position vector will give you a directional vector from your position to your goal.