Forum

Match Average Heading

Hi, I was just wondering how to take the length and angle from the ‘heading’ node and turn it into a single vector?

I want to add this vector to the particles so I they try to match their heading…

Or is there a better way to implement match heading force for all the particles?

Hi, I was just wondering how to take the length and angle from the ‘heading’ node and turn it into a single vector?

just use FrameDifference (Animation) instead, it outputs the vector between current and last position, when applied to positions.

if you are talking about the particles plugin node, then you have to note, that the direction and velocity input is only the initial state of a particle at the very moment it is created. means you cannot influence the direction vector during flight…
further, if you enable ‘influence’ and ‘is influenced’ you can add some heading force with the ‘influence abount’ pin.

Thanks for the reply tonfilm! I am not using the particles plugin, I am trying to implement a boids patch.

I want to average the heading direction and then sum in a vector to each boid so as they head towards that direction… Is this possible with FrameDifference?

Thanks!

yes, that can work, but to average the vectors you have to split them in x, y and z values. made this patch for a quick test:

average_heading.v4p (8.5 kB)

Thats great, thanks a lot for your help! So now that I have the average heading, whats the best way to steer the boids towards that? Just sum it in with the other behavioural rules?

yes, with a factor maybe, add it to the force or velocity vectors…

Yep, got it thanks! Really appreciate the help, cheers!

maybee a little apart from this topic; i found this thread by searching for boids on this site. but also i found some screenshots called boids-directx-something from deep sea. really fancy. there seems to be already an implemtation? or was it tonfilms particles?