I’m not quite sure what animation nodes can do yet. I’m trying to think of a fast way to fill a volume with objects. Rigid body simulation you say? Yeah, it’s Really slow if you need thousands. Current progress is I have a particle system emitting in a volume all at once. Zero gravity.
Then I’m using AN to instance the object, give them all random rotations since it seems the only info from particles data is location and if it’s Alive or other. Created a loop input to adjust rotation random. Remember, I’m not animating here. I am Just trying to get the object filled. I assume it wouldn’t be difficult to also randomize the scale just a bit as well using the same method.
So I add a Rigid body active to the filling object, and a passive to a copy of the volume which I turn inside out. The objects that overlap cause a bit of an explosion, and they are limited by the outside volume. Perfect. Only…it’s still a rigid body simulation, so Slow. But it’s at least Much faster than the methods I’ve seen on youtube where you make a funnel and just have a ton of duplicates from above.
So this got me thinking:
Is there a way, with animation nodes, to sort of create your Own simulation? Assuming the volume isn’t complex, then you could create objects one at a time and run them through a loop where the object moves in set, user defined, increments until it touches the volume surface, then step back one and stop. Repeat at user defined angle changes through 360 deg. Then repeat again until it touches the objects already positioned.
Basically it’s just shooting objects out doing a Very basic simulation with no bounciness or calculations considering velocity. I don’t Think there is a way to calculate if two objects have touched, but you should be able to figure that out if the objects and the volume are both solid because you can check if is inside? or is there a boolean result?
I know this method isn’t perfect, but it’s a lot better than trying the method I’m using because what I’m currently looking at, I would need approximately 9000 objects inside. And as soon as I get the volume Close to filling, there are too many initially overlapping pieces so it takes Forever (if at all) to initially pull apart. But using this other method it would fill outside in, so if you just need the appearance of an object filled, you can stop after 3 or 4 layers.