Jump to content

[SOLVED]Point max distance (Plasma look)


Recommended Posts

Hi. I have a particle sim where I have dense and sparse particle areas.

I would like to set pscale for all sparse particles close to 0.

I made this wrangle following Entagma tutorial with forloop, but when I apply this wrangle to the sim with millions of particles, it`s way too heavey.

Any other approach how I could achieve same result?

Attached there is hip. And using Cd just for visualization purposes.

 

Cheers

Janis

points.hip

points.jpg

Edited by cudarsjanis
Link to comment
Share on other sites

9 hours ago, bunker said:

you can try with pcnumfound(), have a look:
point_density_bunker_001.hipnc

This works nicely. Just rendering now to see how it works for moving particle cache.

Thanks a lot!

I`m doing this post sim as I couldn`t get my particles do that in the sim. I used pop vop for vel update and was mixing v with noise to get particles more streaky together, like plasma. it works untill some point and then the further they get away, some of them just leave dense areas.

Basically I was trying to get whitewater foam like behavior, so sim is streaky.

any idea how I could use pcnumfound() in pop wrangle. where less dense particles would try to stick to areas where is more dense?

I`ll attach hip. How far I got for this plasma look.

Cheers

Janis

pop_noise.jpg

points2.hip

Link to comment
Share on other sites

sure, you need 2 things:
- finding how many points are within a radius: with pcnumfound()
- finding the average position within that radius: with pcfilter()

// pointcloud handle (found points within a radius)
int handle = pcopen(0,"P",@P,chf("radius"),chi("maxpoints"));
// average position within a radius
vector p = pcfilter(handle,"P");
// point density (normalized)
float density = pcnumfound(handle)/float(chi("maxpoints"));
// display density
@Cd=density+{0,0,1};
// move points towards the average position
// particles with less density will move more
@P += (p-@P)*chf("regroup")*(1-density);

5d3918aaf06d1_ScreenShot2019-07-24at7_47_22PM.png.d1bfc9a2fc7a4847b380fc128c3ce1a3.png
points3.hipnc

  • Thanks 2
Link to comment
Share on other sites

On 24/07/2019 at 10:50 PM, bunker said:

sure, you need 2 things:
- finding how many points are within a radius: with pcnumfound()
- finding the average position within that radius: with pcfilter()


// pointcloud handle (found points within a radius)
int handle = pcopen(0,"P",@P,chf("radius"),chi("maxpoints"));
// average position within a radius
vector p = pcfilter(handle,"P");
// point density (normalized)
float density = pcnumfound(handle)/float(chi("maxpoints"));
// display density
@Cd=density+{0,0,1};
// move points towards the average position
// particles with less density will move more
@P += (p-@P)*chf("regroup")*(1-density);

5d3918aaf06d1_ScreenShot2019-07-24at7_47_22PM.png.d1bfc9a2fc7a4847b380fc128c3ce1a3.png
points3.hipnc

Dude, you`re a legend! Works perfectly. Just gonna adjust influence by age, as I need that only for the tips at the shot that I`m working on, and it`s done.

Thanks a lot.

Cheers

Janis

Edited by cudarsjanis
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.

×
×
  • Create New...