Mark01 Posted April 7, 2021 Share Posted April 7, 2021 Hi All! I am trying to simply advect particles using the geometry of an object moving past them - I'm just looking for a small bit of interaction between them. Could someone point me in the right direction. Searching it online, all I seem to find is "popAdvectByVolume". Thanks so much!! Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 7, 2021 Share Posted April 7, 2021 @Mark01 Open in Houdini 16.5 CHOKOLADA.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Mark01 Posted April 7, 2021 Author Share Posted April 7, 2021 @Librarian Thank so much for that! I'm running h18. Is this file only for h16.5? Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 7, 2021 Share Posted April 7, 2021 @Mark01 Old particle system "POPNET" from 16.5 can be reproduced in 18.5... if you have time download 16.5 open and investigate..Have Fun Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 8, 2021 Share Posted April 8, 2021 (edited) @Mark01 if someone Have Time? to make this for solver and 18.5 I don't understand clearly #pragma label damp "Damp" #pragma label springIdx "Spring Index" #pragma label magExp "Magnet Exponent" #pragma label magnetScale "Magnet Scale" #pragma label maxDist "Max Distance" sop SpringMagnet(float damp = 0.9; float springIdx = 0.5; float magExp = 1; float magnetScale = 0.5; float maxDist = 1; ) { vector target = point(1, "P", 0); vector rest = point(geoself(), "rest", ptnum); // get the spring force based on the rest position vector displace = rest - P; vector springForce = displace * springIdx; // get the magnet force from the target position vector magDist = P - target; float distance = length(magDist); vector magnetForce = set(0,0,0); if(length(distance) < maxDist){ distance = pow(fit(distance, 0 , maxDist, 1, 0), magExp); magnetForce = normalize(magDist) * distance; } vector mainAcc = magnetForce * magnetScale + springForce; v += mainAcc; v = v * damp; P += v; } Edited April 8, 2021 by Librarian 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.