Showing posts with label primitive normal. Show all posts
Showing posts with label primitive normal. Show all posts

Tuesday 27 September 2016

Snap surface points to another mesh, based on distance

Eg. When you have a simmed fluid not quite sitting on it's collision surface/ intersecting & you want it to be fixed/better.

Using a Point Vop. Plug in the surface and it's "collider".
Drop down a xyzdist plug that into a primitive normal. Hook up the appropriate inputs, don't for the the "file" input in the primitive normal. Set the max search distance to something sensible (probably a small value)

Plug the resultant "dist" from the xyzdist into a fit range node and promote the max value to the object level. In the destination value, set the min to 1 and the max to 0. Multiply this by the distance to avoid affecting the entire object (the max value will clamp a lot of values to 0 and nullify it)

Plug things into a displace along normal node. Promote the scale value. Finally connect the final P value.

It's worth having a group node with bounding points to check how well it's all worked.