dpap Posted December 11, 2014 Share Posted December 11, 2014 How can I push points that are inside a volume so that they go to the the surface of the volume? I suppose that is one way of getting a collision deformer like in the link below http://vimeo.com/55876041 I tried the Ray Sop but the point stick to the wrong side of the geometry. The tricky part is that they are already inside the volume and not approaching with some kind of animation. I tried the technique use in the Waterfall- Go Procedural tutorial just to test things , but no luck (although I really don't want to use Pops and loose my geo..) Thanks Push Point Out of Volume.hip Quote Link to comment Share on other sites More sharing options...
edward Posted December 11, 2014 Share Posted December 11, 2014 Sorry, no time to look at hip files but what about computing the gradient of your volume and then advect the points through it? Quote Link to comment Share on other sites More sharing options...
dpap Posted December 12, 2014 Author Share Posted December 12, 2014 Thanks for the tip Edward. It works now but it gets really ugly if push the sphere beyond a certain point so I guess it is not the right approach for what I want do. Same results both the volume based solution as with RaySop. Just uploading the working (kinda..) for anyone who is interested Push Point Out of Volume 1.hip Quote Link to comment Share on other sites More sharing options...
br1 Posted March 20, 2015 Share Posted March 20, 2015 Hey Edwards, I was just wondering if you could elaborate on your method. I'd like to get a volume sphere push random points out of it's volume and wondered how you would approach that. Quote Link to comment Share on other sites More sharing options...
koen Posted March 20, 2015 Share Posted March 20, 2015 (edited) When you convert on object to a Signed Distance Field, the values in the volume will represent the distance to the surface. If you take the gradient of the sdf, you get the direction to the the nearest point. So to move the point: P = P + (Sdf value at P) * (gradient of the sdf at P) . I always forget it negative is inside or outside, I believe this is also different between native houdini volumes and vdb's. But you can check the sign to see if you are inside, and only apply the offset to these points. If you use a vdb, make sure you fill the inside (or at least make the inside band thick enough to catch all the points inside). Hope that helps. Cheers, Koen Edited March 20, 2015 by koen 1 1 Quote Link to comment Share on other sites More sharing options...
pbarua Posted March 23, 2015 Share Posted March 23, 2015 (edited) Wire SDF to second input of AttribWrangle: vector grad = volumegradient(1, 0, @P); float dist = volumesample(1, 0, @P); if(dist <= 0) @P -= normalize(grad) * dist; Edited March 23, 2015 by Pradeep Barua 1 1 Quote Link to comment Share on other sites More sharing options...
pbarua Posted March 23, 2015 Share Posted March 23, 2015 Some examples are here: http://forums.odforce.net/topic/21358-collision-depth-how-far-are-points-inside-another-geometry/ Quote Link to comment Share on other sites More sharing options...
pbarua Posted March 23, 2015 Share Posted March 23, 2015 Here is another example: push_points_out_of_volume.hip 2 Quote Link to comment Share on other sites More sharing options...
br1 Posted March 23, 2015 Share Posted March 23, 2015 Thank you Pradeep, it's working great ! I also liked the examples from the other thread, very nice ! 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.