ndeboar Posted December 15, 2016 Share Posted December 15, 2016 Hey, See attached. How would I get the particles to stick to the surface of the deforming tube, while still flowing over it? The volume gradient & cross product vector works nicely when it's static, but falls apart when I add deformations. Ta, Nick noodle_v3.hip Quote Link to comment Share on other sites More sharing options...
Sean-R Posted December 15, 2016 Share Posted December 15, 2016 Hi Nick, You can do a volume sample to get the particles offset from the sdf, multiplying this with the volume gradient will give you a vector. Adding this vector to the particles position will move it onto the surface, the vector will have to be negated to work correctly. noodle_v4.hipnc 1 Quote Link to comment Share on other sites More sharing options...
ndeboar Posted December 15, 2016 Author Share Posted December 15, 2016 Makes sense! Cheers. Quote Link to comment Share on other sites More sharing options...
iFight4theUser Posted December 16, 2016 Share Posted December 16, 2016 If the geo is too complex or thin for VDBs you can try using xyzdistance inside the solver to pull the nearest surface position. You'll need to recalculate your velocity vectors afterwards though, so not as elegant as the VDB solution. Nice example Sean the volume gradient idea is really clever. int primID; vector primUVs; xyzdist(1,@P,primID,primUVs); // get the primID and primUV of the nearest prim on input2 @P = primuv(1,"P",primID,primUVs); // move the P to the position on that primitive 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.