RBD chains

CONSTRAINTS and RBD/CHAINS

Well when studying Houdini one day, I said to myself, why not create chains hanging from some ceiling.

You guessed it right. During the process I finally understood I didn’t understand constraints as much I thought. But reading CG wiki, and other resources, I finally came to my “aha” moment.

This setup consists of a chain hanging from an attachment (ceiling).

The series of chains can be simulated using two different setups, the wire solver and constraints with RBD packed objects. I noticed that using RBD and constraints was more pleasing to the eye and didn’t need a lot of tweaking. The setup using the wire solver needed a lot of tweaking and still didn’t offer very favorable results (at least to my judgment). As you may have guessed. That’s the reason why I explain the setup here using RBDs. Find hip files using the following links. RBD setup , WIRE solver setup.

Looking at live references one would notice that these chains are rigid bodies which have joints. Simulating them using rigid bodies would just be fair. Before I go further, understanding of this technique requires knowledge of how rbd packed objects, constraints and the bullet solver works. Please visit Houdini help manual, CG WIKI and my page on hard constraints.

Basically a hard constraint can be thought of as a kinematic link or joint (I prefer to think of hard constraints as universal joints LINK). For a quick refresher they are simulated in Houdini using points and primitives

If we wanna constraint object 1 to object 2, there must be two points with s@name attribute object1 and object2 respectively, telling the solver to attach object1 to point1 and object2 to point2. So far I think the positions of these points determined the pivots for rotation for the objects. The reason why if two objects meet at the same point like EX2 above, the constraints need to be scaled to about 0. I will stop here now. Please Visit my page on HARDCONS.

HIPFILE BULLET HIPFILE WIREsolver

PROCEDURE AND SETUP

I will go through this in SOPS land and in DOPS. Of course there is some vector math involved.

IN SOPS. (take a look at the video here)

-Setup a curve using the curve sop (this can be any type of Houdini primitive).

-Feed this into the chain HDA on my page which can be download here.

-The chain HDA produces a resampled curve (output2) and the packed chain geometry (output1).

-The resampled curve is then sorted by y (which isn’t fully procedural) so that points are numbered from top to bottom

-I use a wrangle to store the position of the first point into a detail attribute. This wrangle also stores the opposite direction to the next point (from normal produced by chain HDA). Why? This attribute would be used to attach the first chain to a static box object. (There are many ways to get this done in Houdini.)

-I follow with another wrangle which creates the constraints, sets their corresponding point and name attributes for interaction between the individual chains. (remember for hard constraints the points are created exactly where you want the objects to rotate, which in this case is the centroid of the primitive).

-Next using the attributes I stored earlier, I create constraints to attach the first chain to the static box.

-I initialize the constraint attributes in the next wrangle and …. Voila which is French for ‘and then I found out’…. this can then be feed into a Dopnet for simulation.

-For the chains, the chain HDA automatically packs the chains, so I feed this into a wrangle to put in the name attribute. Then I merge the box (packed, inactive) and the chains and feed them into the first input of the Dopnet.

IN DOPS.

The setup is straight forward. RBD packed object to read the pieces for simulation, constraint network and hard constraint sop, bullet solver, gravity and wind force, a ground plane and output dop.

-On the RBD object I changed the collision geometry to capsule. (I found it more reasonable given the shape of chains).

-I added some noise to the wind through the noise tab of wind dop which activates it after every 10 frames. I increased the constraint iterations in the bullet solver to 20. The rest is really just rendering. That’s it, overall it looks like.

Entire setup.

Please visit CHAINS WITH WIRE SOLVER for an in-depth look using the wire solver. Thanks for reading.