Orienting instanced birds

   7880   11   3
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
I'm working on a bird flock simulation system basically using particles, follow and interact and it's starting to look quite good. However I've now come to the part where I would like to copy my bird geometry on to my particles. And I can't seem to come up with a set up which gives my bird a good rotation.

Without doing anything it works ok for some parts of the animation but all of a sudden my birds start flying upside down or in another weird rotation angle along their current direction.

How can I simulate the banking of the birds when turning, yet make them able to change altitude without flying upside down?

I've experimented a little with both the Rotation POP and the Orient POP but haven't found any good solution yet.
User Avatar
Member
7721 posts
Joined: July 2005
Online
So your birds are being aligned to the velocity of the particles right? Make sure you have normals set to (0,1,0) on the particles when copying the bird geometry.
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
edward
So your birds are being aligned to the velocity of the particles right? Make sure you have normals set to (0,1,0) on the particles when copying the bird geometry.

I tried that by using a point SOP and adding a normal of 0,1,0 to the particles. This however makes them have no rotation at all. But perhaps I did something wrong.

I forgot to tell but the birds are supposed not only to fly in a straight line but also change directions and therefore static rotation won't work.
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Trying setting an initial up-vector with the upvector POP on the first frame. The simulation should then update the up-vector for you.
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Ondrej
Trying setting an initial up-vector with the upvector POP on the first frame. The simulation should then update the up-vector for you.

How could I've missed that node. Houdini just keeps surprising me with simple solutions. However when setting the up vector to 0,1,0 (or $UPX, 1, $UPZ) in the up vector SOP I loose the banking the birds sometimes (when lucky) were having before.

So with that problem solved a new one appears. How could I have the birds bank when turning? Independent per bird/particle. I'd like to keep it as procedural as possible and don't animate this manually (which would be on the whole flock instead of per bird/particle).
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
Are you only activating the upvector POP on the first frame? Or, alternatively, applying it to only the particles birthed that frame?
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Ondrej
Are you only activating the upvector POP on the first frame? Or, alternatively, applying it to only the particles birthed that frame?

Yeah I tried that, both with Up vector Y as $UPY and as 1.
I put together a file with a very simplified version of my setup to make it easier to understand what I may have gotten wrong.

Attachments:
flockExample.hip (61.0 KB)

User Avatar
Staff
1072 posts
Joined: July 2005
Offline
I misunderstood what you were after. The type of banking you're looking for is typically something you would use CHOPs to add procedurally. You'll want to import the acceleration into CHOPs, use it to compute a banking angle, and then export that back out to the copy SOP.
User Avatar
Member
166 posts
Joined: Oct. 2008
Offline
Ondrej
I misunderstood what you were after. The type of banking you're looking for is typically something you would use CHOPs to add procedurally. You'll want to import the acceleration into CHOPs, use it to compute a banking angle, and then export that back out to the copy SOP.

That sounds like an excellent way for me to get into CHOPs which I have totally missed out on. I'll give it a go this weekend or on Monday and see if I'll get it working. But you'll probably hear from me again.
User Avatar
Member
142 posts
Joined: Feb. 2012
Offline
Anyone get a good CHOPS solution to this?
Showreel 2013 [vimeo.com]
User Avatar
Member
1529 posts
Joined: July 2005
Offline
You need to rotate the up vector about the velocity vector, by the magnitude of the XZ acceleration.

When the bird ‘turns’ it accelerates (centripetal). The magnitude of that acceleration is proportional to the bank magnitude. Note that in this case, you'll want to disregard the Y term of the acceleration in order to avoid taking into account a steep climb or fall.

It's also interesting to look at offsetting the resulting bank by a few frames either forward (for anticipating bank), or backwards (for reacting bank)

By way of particular hints, you can take the second derivative of position (slope chop) to get acceleration.

Holler if you need more tips.

G
User Avatar
Member
142 posts
Joined: Feb. 2012
Offline
Cheers,
I havent been in chops for ages (to do anything more than smoothing curves!)
Would I be using chops just to calc the accel then do the rest in a vopsop? I wouldnt mid getting it working in pure CHOPS if possible but I haven't the chops (sorry for the pun )
Showreel 2013 [vimeo.com]
  • Quick Links