There is no doubt that Houdini is a most unusual creature, for this is a hamster with an advanced vocabulary and a terribly immodest opinion of his own superior brain power. Houdini believes without question that hamsters are a higher form of life than humans. He is, however, a kindhearted creature (generally speaking) and tolerates the bumbling ways of humans well enough.
Search This Blog
Here is a setup that does snapping wires...
Wires are pre-cut and the cuts get constrained together, in DOPs a sop solver removes points from the constraint groups based on how much the edge length is stretched. The tricky part about this is that the groups have to correspond exactly so that the edges get constrained together properly...
In SOPs before the sim, each line gets cut in two with a carve SOP. One side of each cut is put into a group, and the other side in another group. I use these groups in the constraint in DOPs to constrain the cuts together. Also, the points in side 1 of the cuts has a 'partnerPoint' attribute which stores the point number of the point on the other side of the cut. This is so that the groups can be rebuilt later.
In DOPs there is a SOP solver to remove points from the groups. For one side of the cut, the edge length is compared to the rest edge length, if it is longer than a threshold the point is removed from the group. The second group is rebuilt using the first (now modified) group and the partnerPoint attribute.
I have always wanted to do a dynamic locomotion setup, I have tried in the past with wire and sop solver with .... interesting results ;)
With FEM in Houdini 13, the rest attribute is stored on vertices which allows a tetra to change its rest state independently of the surrounding tetras. With this, parts can be expanded and shrunk to get a muscle type action.
I have started with a worm since it is quite simple, the contractions and expansions move back along the worm in a wave, opposing the travel direction. It took quite a bit of tweaking to get him moving at all. One major element of a real worm's action that's missing is the little hairs that grip the ground. I couldn't find a way to change the friction per point so I have gone a bit hacky and multed down v wherever I didn't want the worm to move. I would love to hear if there is a per point friction control!
Been adding geo detail to the torn cloth and shading the additional geo. Shading sure is fun! :)
The second extrusion is done twice, once for the U direction, and once for the V direction. Polyframe is used to get the UV gradient to extrude along, vopsops are used to move the extrudeFront points after extrusion as you can't control the extrusion per point with just a polyExtrude node...
The extrusion is done twice so that the two different surfaces represent the opposing thread directions. since my geometry (and therefore tears) are in line with the U and V direction, the effect is not obvious in this case.
The .hip file below has a slightly newer shader than in the video and the image above, I removed the part of the shader that created the soft ramp for the alpha edge and used just the thread noise instead; it now looks more like:
The UV space can be transformed after the sim to change the thread direction, the following has the UV space rotated 90º, you can see threads running …
Every time I go to extract the border from a mesh I always end up using some strange combo of Group unshared edges, delete and dissolve, I came across a good way of getting unshared edges that I haven't thought of before, and now it seems really obvious ... using the polycap node to trace the border and then deleting all of the source prims, works like a charm!
I have also usually had trouble with splitting up a line into multiple primitives, here is a way to create a primitive per edge. This example only works if every point has 2 neighbours but could easily be modified with a copy SOP to allow a dynamic amount of neighbours. (instead of 2 vopsops and a merge to duplicate the points).
It works like this: The point number is stored in an attribute to create a unique number for each pointThe whole mesh goes into 2 streams to duplicate every point.For the first set of points, each point gets the point number of the first neighbour and applies a cantor function to create a unique numb…