Jump to content

Stick points to growing geometry


Recommended Posts

How do I stick points in place to growing geometry? 

Currently, when the geometry is growing and the points are adding and changing point numbers so if I copy anything on to them, everything is moving around. So the final solution would be to make the scattered points stick in the same place.

Link to comment
Share on other sites

Since your target geometry has a changing point/prim count, you'll probably want to handle the points-sticking behavior as a solver, preferably inside the same solver that's handling the growth. You can use minpos() in VEX to compute the nearest point on the growing surface to each existing point and stick that way, or if you need to stick orientations as well, use xyzdist() to get the nearest primitive and primitive UV on the growing surface to each point, then use primuv() to sample P, N and up from the growing surface, move each point to the sampled P, then set N and up for each point based on the sampled values.

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

29 minutes ago, toadstorm said:

Since your target geometry has a changing point/prim count, you'll probably want to handle the points-sticking behavior as a solver, preferably inside the same solver that's handling the growth. You can use minpos() in VEX to compute the nearest point on the growing surface to each existing point and stick that way, or if you need to stick orientations as well, use xyzdist() to get the nearest primitive and primitive UV on the growing surface to each point, then use primuv() to sample P, N and up from the growing surface, move each point to the sampled P, then set N and up for each point based on the sampled values.

I'm using this simple setup but I'm still not sure how to use the minpos function to make it work. Here is my file, I appreciate if you can push me in the right direction.

growth.hiplc

Link to comment
Share on other sites

I'm not sure I understand exactly what this solver is doing. Is the end goal to have these points reveal themselves over time as that color spreads over the grid? If so, why not scatter all the points at once on the full grid, then transfer your color attribute over from the grid to the points, then delete points that don't meet the color threshold?

Link to comment
Share on other sites

1 hour ago, toadstorm said:

I'm not sure I understand exactly what this solver is doing. Is the end goal to have these points reveal themselves over time as that color spreads over the grid? If so, why not scatter all the points at once on the full grid, then transfer your color attribute over from the grid to the points, then delete points that don't meet the color threshold?

It was just a quick setup to try your suggested solution. The real setup is driven by cost propagation and doesn't use any solvers so the principle should be the same I believe. Maybe there is a simpler solution like you have mentioned before. I probably need to find another way of applying the propagation effect.

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...