Search - User list
Full Version: Connecting particles with a mesh
Root » Technical Discussion » Connecting particles with a mesh
somethingtohide
I'm trying to learn Houdini, but I'm reaching a few points where I don't know what I can do to get the effect I'm after. I've watched a few cmiVFX tutorials on procedural animation and particles and I've learned a lot, but nothing that would help me do what I want to do.

My end goal is to have a particle emission system where every time a particle is emitted, it searches (probably by nearest neighbor) for another particle to “connect” to, preferably one that doesn't have too many connections. When it finds one to connect, it creates geometry between them, like a polygon cylinder with it's caps being at each of the particles.

I thought that I was going to have to use some scripting to do that, which is fine for me because I've been using Python for years now, and I can probably find as much info as I need with Houdini's Python.

I've been creating small scenes one after the other trying to learn the different things I'll need to create this. Right now, I want to connect particles together with geometry.

I've tried two ways. The first way, I was emitting particles from the faces of geometry like a simple torus. I wanted to join each particle together into a NURBs curve, so that each face that was emitting geometry was creating a curve that I could Sweep something along. Right now, I've made a Grid and a Scatter node on that, and then animated the Grid along a motion curve. By using a Trail node, at the end of the animation I have something very similar to what I want. If it's set to Preserve Original, I get a string of particles that I would like to join into a curve. If it's set to Connect as Polygons without using Close Rows, I get something even closer to what I want. But it seems that it's creating very thin geometry, as if there's only edges and no faces.

Ultimately, I'd like to end up with a curve that was stitched together by the particles that I could render in Mantra or 3Delight, or sweep something along to create actual geometry.

So, I'm here asking for your advice. Thank you for any help you can give.
tjeeds
Have you checked out the Tetrahedralize SOP? When set to connected polylines it will creates edges between a field of points, you can then use a Polywire sop to create connected geometry around them. They will dynamically rewire though, so it might not be exactly what you're after.
somethingtohide
Just tried adding a Tetrahedralize set to Connected Polygons. It seems to connect the ends back together as well as connecting many things, similar to what the Trail did whenever Close Rows was checked.

However, you got me on the right path. Using a Polywire after the Trail when it is set to Connect Polygons and Close Rows is off works by creating the geometry along those created lines.

Thank you for answering that for me.

That brings me to my other solution that I alluded to in my first post.

If I create a point emitter that is animated and emits points that never die, how would I go about generating cylinders on each particles birth that connect to another point? It would have to remember the point because as the emitter animates, the cylinders should stay connected to the same points so they don't jump around.

I'm just thinking this out as I'm typing it because I'm not at my machine right now.

I would need a way to execute something (a scripted node or another node chain) each time a particle is born. Then, whenever it is born, I check the nearest particles to see if they have no more than five connections. If it doesn't, then I would connect the two particles with a Line that I could then use Polywire to generate geometry, right? It would have to know the points because the particles would be moving based on the inherited velocity of the animating emitter, so the cylinders would be slowly getting longer as the points grew away from each other.

I'm attaching a file of what I ended up figuring out with your suggestion. It's as bare-bones as possible: particles animated with geometry connecting them. The Timeshift node is set to freeze it to frame 240 so that the geometry is always there. If you want to see the geometry created from the animated particles as they animate, bypass that node.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB