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:
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
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 oppathvopsop1 adds growRate to pscale if it is colliding, vopsop2 just maintains roughness if the point is growing and decays it otherwise.
#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);
}
}
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
oh~awesome work!
ReplyDeleteHi, 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.
ReplyDeleteshould be a h11 scene but I will update it when I have a sec!
ReplyDeletetook me a while! swapped out the VEX node for a VOPs one.
ReplyDeleteCould be optimised but it works ...
http://users.on.net/~tmsmsa/PC_grow.hipnc
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. :(
ReplyDeleteI will check it out, there is probably a much better way of doing this now!
ReplyDeletevery cool effect.
ReplyDeleteI like your work man! thank you.
is there any chance to do it in H 15 ?