Jump to content

centered Point per Primitive


Recommended Posts

just beware of the flaw of getting the 'center' with this method...it's just 'average pos' rather than actual center of mass. So in the fig attached, the 'center' point is nearer to the pointy end which is simply wrong if you go by center of mass idea.

More in this thread:

 

PrimCentre.jpg

Link to comment
Share on other sites

15 minutes ago, Noobini said:

just beware of the flaw of getting the 'center' with this method...it's just 'average pos' rather than actual center of mass. So in the fig attached, the 'center' point is nearer to the pointy end which is simply wrong if you go by center of mass idea.

More in this thread:

 

PrimCentre.jpg

I understand what you mean; therefore without it being accurate, what is wrong with my setup as to why I'm not getting a point per primitive ?

Would you be able to convert your scene files from that thread to an older version of Houdini, as I'm getting errors upon loading ? :) I'd prefer not to group all my primitives as mentioned in the thread if that choice is available when being accurate.

Link to comment
Share on other sites

screencast-2018-02-24-230535.thumb.gif.15b0ef883cce08b069429aaedc76e0a6.gif

This might help get you where you want to go (probably much more clever ways to do this), but this is how I'd approach the problem. There are a few things happening here (uses some ideas mentioned on other point-to-prim-center threads too):

  • Point Generate SOP to add the points, avoiding the creation and deletion of geometry in a wrangle (to create/delete geometry, at some point VEX has to stop threading to do those operations), which probably only matters on larger geometry, but good to be aware of
  • In a Point Wrangle, move the points to their corresponding primitive position
  • Split apart primitives using Facet SOP, with the Unique Points toggle on
  • After the particle sim, use Primitive SOP to transform the primitives using the particle network
  • Group and delete primitives whose corresponding particle is dead

You probably would be safer to setup an attribute dedicated to the particle-primitive relationship, but hopefully this helps a bit!

addpoint_perprim_modified.hipnc

  • Like 2
Link to comment
Share on other sites

Here is a version using 15.5, which is as far back as I have installed. Often times, these warnings can be ignored (you know if the scene works, hehe). In this case, a fair bit didn't work.

@elemnum is a pseudo-variable, which will refer to the point or primitive, depending on the type of wrangle it's running in.

Hopefully you can get 16.0/16.5 as soon as possible, there are lots of excellent quality-of-life improvements (i.e. Group Expression).

addpoint_perprim_modified_15_5.hipnc

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