Jump to content

Fluid sim along a surface?

Recommended Posts

Hi guys - 

I need to make a realistic wave, but I need to do it by sourcing a mesh for the flip particles. The mesh will be in the shape of the wave. Then I need to use the UV's of the mesh to push the flip particles along the surface.

Does that make sense? and can anyone help me out here? 

Thanks in advance.

Here is my 'oh I give up" file:


Edited by cwalrus

Share this post

Link to post
Share on other sites

If you want to move points along a surface based on texture UVs (not per-primitive parametric UVs), you need to do a little magic with xyzdist() and primuv(), or XYZ Distance VOP and Primitive Attribute VOP if you prefer.

Convert your UV attribute to Point type, then use a Point Wrangle to move your point position to v@uv. Don't forget to store your original point position in the Wrangle, or via a Rest SOP. Then give each of your particles a goalUV vector attribute.

Then use xyzdist() to find the nearest primitive # and parametric UV to your distorted surface. Store that primitive number and UV coordinate on your particle as point attributes (posprim and posuv are what particles use internally for sliding).

Then move your mesh back to world space using a Rest SOP or a Wrangle, and use the primuv() function on your particles to find the "P" attribute based on posprim and posuv. This should return the nearest point on the surface given the goal UV you defined earlier.

I'm attaching a .HIP to make it a little easier to read.



  • Like 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now