Particle Interaction

   13207   9   1
User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
Hi guys,

I tried a search for this, but it came back with over 400 hits, quite random results.
I've created a particle network, which I want interaction between the particles, in the form of them staying away from each other, controlled by meshes that are to be copied/instanced to the particles. Kind of like a crowd scene.

Herein lies the problem. I have an attributecreate node in sops's to create a attribute called radius. It is set to vector, and runs an expression in each field respectivley…


vector3($SIZEX, $SIZEY, $SIZEZ)
vector3($SIZEX, $SIZEY, $SIZEZ)
vector3($SIZEX, $SIZEY, $SIZEZ)


This returns what I expect. The mesh is animated (deforming) so the radius attribute reflects that as it animates. The problem is getting the particle interaction to work based on this attribute. I have attributetransfered the point attribute into pops, but I cant get it to work in the interactpop.
This is something ive never done before, so I really dont know the workflow.

Any help would be appreciated.

Cheers.
User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
Just as a visual aid, this is the test scene. I want the sentinels to stay apart from each other. No closer than their own bounding boxes. In this example they are birthed from a location pop. In the first draft, they will be birthed from a circle with a much wider spread than this.

User Avatar
Member
951 posts
Joined: April 2008
Offline
You can try to use the interact pop to keep them a distance from each other.
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
Thanks for the reply. I have been playing with the interactpop, I was hoping that there was a way to use a custom attribute to control their action within the interact pop. I can hardcode a radius in the interact pop, but with the tenticle animations this still causes interpenetration between meshes. That is why I really wanted to use the attibute.

Im still working on this, but keep drawing blanks at the moment.

Cheers.
User Avatar
Member
152 posts
Joined: June 2008
Offline
Maybe you could apply “point” force's with a POINT SOP onto your geometry, and use it with an attractor pop as a force field?
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Couldn't you just type the their radius attribute in the radius parameter on the Interact POP?

Create an attribute, “particleradius” for example, then just use $PARTICLERADIUS in the radius paramter?

Perhaps that is what you've already tried and I've misunderstood you but that should work as far as I know.
User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
Thanks for the help xtimmyx. I could hardcode the radius in the inetractPOP, but the tenticles are to be animated, and each sentinel will have a slight offset to the tenticles. This means that their radius will be constantly changing. This is why I wanted to use an attribute to control their distance from each other.

I have tried using attributes inside the interactPOP, it was the first thing I tried. The attribute I created was called radius ($RADIUS), and the interactpop just doesn't recognise it, and throws up a red error saying “Unable to evaluate expression (Undefined Variable obj/instance1/popnet1/interact1/pradius)”

If I have to specify and hardcode a radius in then so be it, I just wanted to do it procedurally.

Cheers
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Hmm, weird. It works for me, but perhaps we're thinking of two different things. Anyway I've uploaded my test scene. Their radius is just basically their Z position multiplied with the time.

Attachments:
interactWithAnimatedRadius.hip (45.0 KB)

User Avatar
Member
349 posts
Joined: Aug. 2006
Offline
The difference I can see between my scene and your example, is Im trying to use a SOP attribute, wheras yours is created inside POP's. Ive attributeTransfered the attribute from sops to pops. Perhaps thats what the issue is.

Cheers
User Avatar
Member
110 posts
Joined:
Offline
Boy this brings back memories, I did this exact same thing like 4 years ago back when I was first starting out 8)

The way I'd recommend you try this is having a look into what's known as Boids [red3d.com]. It's slightly complex to get it working right, but you can pretty much get it working from the papers via vops or vex.

I'm gonna have to search for my files and see if I find my old scenes for this.

PS. I hope you're going to be setting up a rig for the tentacles, hint, curve with a point expression with sin and clamping it down from the start of it to get the swiggly movement and then using a polywire to turn it into a box to either deform a mesh, or use it as a lowrez version of it. And raytracing Mantra is your best friend :wink:
  • Quick Links