Skip to main content

Growing Objects

I saw this post over at odforce and have been playing with growing objects in a dynamic way ...



It is basically just points scattered in the volume of an object, then a SOP solver is used to increase a points pscale if it is colliding with another point. Metaballs are copied onto the points, converted to polys, then cookied with the original geo (not in the video above though...)

This is the source geo and with the scattered points:




Some attributes are added for the sim:



The pscale attribute is set to 0 except for one which is set to maxSize to start the sim going. Roughness starts at 1 and decays when a point has stopped growing, this later is fed into the shader to increase the cone angle on the reflections and refractions...

These points get loaded into a DOP network and then into this SOP solver:



The pointCloudSop is a little VEX script that tests for collisions between points:

#pragma hint filename oppath
#pragma hint pscale hidden
#pragma hint maxSize hidden
sop
pointCloudSop(string filename="/obj/geo1/PC";
float pscale = 1;
float radius = 1;
float maxSize = 1;)
{
if ( pscale <>
{
string file = concat("op:", filename);

float isColliding = 0;

int numpoints = npoints(0)+10;

int pointcloud = pcopen(file, "P", P, radius, numpoints);

while(pciterate(pointcloud))
{
float dist;
float otherPscale;

pcimport(pointcloud, "point.distance", dist);
pcimport(pointcloud, "pscale", otherPscale);

if ((pscale + otherPscale) > dist) isColliding += 1;

}

addattribute("isColliding",isColliding);
}

}

vopsop1 adds growRate to pscale if it is colliding, vopsop2 just maintains roughness if the point is growing and decays it otherwise.

After that, the rest of the SOP network just copies metaballs onto the points. I was using the cookie SOP to get the intersection between the original mesh and the metaballs but the cookie sop was a bit unreliable :/

hipnc file is here

Comments

  1. Hi, I've tried to open your hip in houdini11, seems borken, I really interested to see how it's working... could you updated it if you have time? Thanks.

    ReplyDelete
  2. should be a h11 scene but I will update it when I have a sec!

    ReplyDelete
  3. took me a while! swapped out the VEX node for a VOPs one.

    Could be optimised but it works ...

    http://users.on.net/~tmsmsa/PC_grow.hipnc

    ReplyDelete
  4. Hey man, can you make it work for H13, please? There's few things different, attributecreate is now 2.0 and it doesn't seem to take your expression ch("../attribcreate_maxSize/value1")*2 on convertmeta. Few other things are wrong as well, sometimes after the dopimport, the delete node will create a small cluster in the middle, but sometimes will not, and regardless the cluster is not growing as it supposed to. :(

    ReplyDelete
  5. I will check it out, there is probably a much better way of doing this now!

    ReplyDelete
  6. very cool effect.
    I like your work man! thank you.
    is there any chance to do it in H 15 ?

    ReplyDelete

Post a Comment

Popular posts from this blog

Some SOPs edges and poly line business

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 point The 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 func...

Worm locomotion with FEM

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! Here is the video Houdini 13 FEM Worm locomotion from Sam Hancock on Vimeo . ...and the .hip is...

Wire to RBD feedback in DOPs

Normally if a wire is constrained to an RBD, the rbd isn't affected by the wire at all. Which is annoying ... but I had an idea to get it to work. the wire solver can store the internal forces on the geometry. In DOPs I made a point force, the position is set to the position of the constraint and the force is the wire's internal (linear) force. I have put a sopnet in the dopnet to get the wire and the constrained point so I can reference them in the point force. It could be simpler with a python expression to get the position and force directly without going through the sopnet, but this is just a little test... For multiple attachment points, I think a copy data node could be used to copy the point force data for each constrained point ... hip file here Wire to RBD feedback forces from Sam Hancock on Vimeo .