Jump to content

Scripting Flocking Behaviour


T-bolt

Recommended Posts

Hi,

For a course project, I'm creating a scene in Houdini involving flocking behaviour. The movement is on a 2d plane, with a group of 10-20 made up of 4 types of models following a leader. I know there are techniques to do this in Houdini without scripting, but I have to script this in some way. Would this be possible using VEX? I already have the flocking algorithm figured out in C code, which VEX is similar to (though without an implementation of arrays <_< ).

Within my function, what I need is to access the translation & rotation values of the members of the flock, and I'm having a problem figuring out exactly how to do this. I've been fiddling around with VEX SOPs, but I'm realizing that's not the way to go about this so I'm considering using either POPs or CHOPs. Right now I'm leaning towards using POPs, would that be a correct assumption? Any help would be appreciated. :)

Thanks,

Paul

Link to comment
Share on other sites

You might want to post to the houdini mailing list about this question as well as there's people there who has probably done this before that don't follow the odforce forum.

Offhand, I think POPs would be easier if you need to maintain state data from one frame to the next. Finally, per point data (ie. translation/rotation/etc) can just be created as attributes (see AttribCreate and Point in SOPs or the Attributes tab menu folder in POPs).

Link to comment
Share on other sites

Thanks for your replies!

Hmmm, I'm not finding any information on point clouds, link?

I've decided on using POPs. Now with VEX POPs, it seems that the function is run once for each particle each frame, and I can change the position and velocity of the current point - so far so good. I'd like to be able to find the position and velocities of the other particles with respect to the current particle for my calculations. Any ideas?

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