cwalrus Posted October 9, 2016 Share Posted October 9, 2016 (edited) 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 October 9, 2016 by cwalrus Quote Link to comment Share on other sites More sharing options...
toadstorm Posted October 10, 2016 Share Posted October 10, 2016 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 2 1 Quote Link to comment Share on other sites More sharing options...
cwalrus Posted October 11, 2016 Author Share Posted October 11, 2016 You are the best. 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.