PDA

View Full Version : Flocking on a sphere



DonJMyers
03-15-2016, 12:05 PM
I have been struggling to hand key ants on an apple. Now the client has changed their mind and wants the ants to flock on the apple, a perfect sphere rotating around it's center at 0,0,0.

I had been using sticky surface but that had problems. RebelHill make a very nice tutorial on getting something to stick to a sphere using nodes: http://forums.newtek.com/showthread.php?150053-Stickysurface-screwing-up-stupidly

So I have a scene with a ball and a null and when I move the null it slides nicely around the edges of the sphere. It even always looks at the center of the sphere. But how do I get a flock of ants to do that? Or at least particles. I can swap the ants in later but just getting the particles to flock ON the sphere is my goal.

Image of the motion modifier nodes I used is below. i just did what rebelhill said. But when I select a null and pick "add scene items" to make a generator in the flock panel NOTHING happens.

Previous posts on this topic really didn't address flocking.

MonroePoteet
03-15-2016, 04:26 PM
I'd use ParticleFX and Collision objects, because that's what I'm more familiar with. Hopefully, someone more capable in Flocking, etc. will post alternatives.

Attached is a sample scene. The (very small) Emitter is placed close to the Apple, and the initial motion of the particles is set up to collide with the Apple. I used some Explosion and Vibration to make the particles (i.e. ants) swarm out a little more randomly. Self Interaction on the particles is set to "Crowd". Lifetime is 0.0 so the particles don't vanish. Particle rotation is set to "Align to Path" although the ants don't seem very "aligned", IMO.

The Apple is a Collision object (FX tab in Object Properties), with "Stick" as the type, 50% Bind/Bounce Power and 20% Roughness to randomize the motion a bit more.

The Table is another Collision object, basically the same setup as the Apple, so any ants (i.e. particles) that escape the Apple wander off on the table.

Maybe not what you're looking for, but potentially something you could adapt to your needs. Good luck!

mTp

DonJMyers
03-15-2016, 04:54 PM
Well I'll check that out but I think I ALMOST solved my problem except that the bugs aren't rotated so their tummies point to the center of the apple. aka the rotation is wrong.

DonJMyers
03-15-2016, 05:06 PM
Calculate the flock and then you will see that they work well they just don't turn correctly. Some are walking on their backs or upside down etc.

I'm sure problem is in the nodes of the flock gen.