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:

FluidAlongShape.hipnc

Edited by cwalrus
Link to comment
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.

 

goal_to_uv.hip

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...