decreasing particle size based on its distance to some object

   2428   5   0
User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
hey there, i'm trying to have some particles decrease size over time when they reach to some specific distance to some object.. if particles are within a defined radius to some object, they start to get smaller .. this is as far as i managed to achieve,uploaded the hip file and i'm stuck with its sudden size change when it gets into the radius range .. thanks for the help ..

Attachments:
particle size based on distance.hip (300.0 KB)

User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Two things.

In your Vop your passing the result of the distance node which is a float into the length node, which takes a vector.

So what happens is the length node takes the one float value and fills all 3 components of the vector needed with that value.

Then it calculates the length of that vector.

Then it gets passed to your compare node which has the threshold value you define.

When that threshold is reached it switches over to your value you defined in your constant node “final_size”.

So it is working as it should.

I'll work out an example a bit later for what you want, if no one beats me to the punch.
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Here's an example using a wrangle (colored red).

You could do the same in Vops..but I'm not versed that - would take me longer.

Attachments:
particle size based on distance v1.hiplc (348.2 KB)

User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
thanks but i was wondering if we could use a solver sop or something, to use time frames to increase size or something like that …
User Avatar
Member
2036 posts
Joined: Sept. 2015
Offline
Yep…I originally had a solver sop - cause I ‘need’ to practice using them, in my original example.

But in this cause I used the solver to stop the pscale from getting bigger again once the particles move away from the object.

This was based on their current @pscale value ‘or’ their @age; Giving the the net desired effect.

Could have added a bit more indepth conditional in reference to @age and write some code to take into account the different velocities of each particle as well.

Attachments:
particle size based on distance v2.hiplc (364.8 KB)

User Avatar
Member
27 posts
Joined: Nov. 2017
Offline
BabaJ
Yep…I originally had a solver sop - cause I ‘need’ to practice using them, in my original example.

But in this cause I used the solver to stop the pscale from getting bigger again once the particles move away from the object.

This was based on their current @pscale value ‘or’ their @age; Giving the the net desired effect.

Could have added a bit more indepth conditional in reference to @age and write some code to take into account the different velocities of each particle as well.
thanks a lot..
  • Quick Links