PDA

View Full Version : Flocking not sticking to ground



peteb
08-18-2013, 06:19 AM
I've posted this in general support as well but thought I'd also post it here.


I'm just playing around with Lightwave 11.5, haven't used Lightwave since 9, so a lot of new things. One thing I want to use it for is the flocking system as it seems really easy to use. I've looked at the available tutorials but can't find any great ones on using imported meshes the use cached geo from Maya.

However I've figured out how to create my flock and attach my imported mesh as an instance to the flock and also how to add multiple versions of the geo cache so that the animations can be varied.

The one area that sill confuses me is how to get them to walk across a poly mesh that isn't flat. I've seen a tutorial where he uses ray trace to get the flock to go over a mesh that's been deformed via a displacement map. I can replicate this fine. But when I go to use an actual mesh that isn't flat, for example one generated using the sculpt brush in Maya or Zbrush or even Lightwave. I find that the flock just to seem to go shooing up in the air and perform their actions well above the actual mesh, that's if Lightwave doesn't crash while trying to perform this.

So how do I get the flock to march across a pre made rough landscape. Also how do I make sure that the legs of the creatures don't penetrate the ground? How is Lightwave placing the instances to the particles, does it base the mesh by it's centre point to the particle.? If so do I need to move my pivot to the foot of the mesh?

It's worth pointing out that I'm using 11.5 not .6 so I don't have access to the new ray trace motion node.

Hope you can help.

Pete B

RebelHill
08-18-2013, 06:50 AM
It should make no difference if the ground mesh is modeled as is, or is the product of displacement... raytracing to get the difference between the mesh's Y spot and that of the instance is all thats needed. However... you must take note of the direction in which this ray is fired... In the case of a displaced mesh... the mesh is often flat on Y=0 and displaced UP... since the instances (or flock particles) are (usually) at Y=0... you trace UP to "find" the mesh... So you have to trace in the right direction to find the mesh pos from the agent pos.

As for getting feet right on the ground... no can do. The flocking system is just particles (single points). This means that this precise point is what gets "stuck" to the ground, if a mesh, instance, or whatever has geo that is "away" from this precise point... it'll stay "in-line" with the point (relatively speaking).

In order to have characters who's legs could independently interract with the ground, then you would have to move away from instances to boned, IKd characters who's rig root followed the particle motion (and ground sticking) and then use an additional trace on every leg, of every character to trace those to correct intersection. Again, this is only gonna give you basic "single point" contact. If you need the foot to lean or otherwise orient itself to lay on the ground (rather than just being "flat" at ground height), then you need a whole buncha extra stuff to get the polys beneath it, their normals (or averaged normals), etc, etc.

peteb
08-18-2013, 03:33 PM
Thanks for the info Rebel.

The animation is of some insect like creatures but they'll be seen from a distance so intersection shouldn't be too much of a problem. What node's should I use to be able to change the direction of the Ray cast?

Ivan_B
09-09-2013, 03:15 AM
Hi,

Could some please explain how to get the flock particles to conform to a displaced mesh in 11.6...just cant seem to get it to work, there is a tutorial showing this for 11.5 but things have moved / changed.

Its probably got to do with the raycast node, but Im not sure how to use it with flocks

Thanks
Ivan.