As I explore Houdini, I find myself continually in awe at the ease with which I can create complex and physically realistic effects. This post looks at creating geometry and applying a heat source to it to cause it to glow and melt.

The first experiment in the video above uses a simple tube, but the second experiment is a little bolder: here I use two toruses and four tubes to build what could be the frame to a bar stool or small table. More accurately  the second experiment uses a single torus and a single tube along with a handful of transforms and a merge to build the geometry:


Which looks like this:


To turn the geometry into something meltable, I applied the Lava From Object shelf tool which turns it into a particle fluid. The two interesting things about the network created by this tool is that the fluid's viscosity and the particle color are both linked to its temperature.

By default, the fluid temperate is 0.5, but by changing this to 0.0 and upping its viscosity, it becomes pretty much a solid. 

To get it melting, I added an additional box geometry and used the Heat Within Volume shelf tool to create a heating volume from it. Note that particles need to be within a heating volume to affect them - my initial attempt to convert a ground plane to a heat source failed because the particles were touching, but not within, the plane.

After these steps, the DOP Network looks like this:


Temperature diffusion within the melting object is controlled by the Gas Temperature Update node: in the second experiment, I upped the radius to 2.5 to increase the conductivity of the fluid. 

A project that was super simple to implement but gives a pretty funky effect!
2

View comments

  1. this is incredible!! :D I'm fairly new to houdini - only a few months now regular twiddling and i cant put it down. Its now at the point where i want to walk away from Maya after 18 years of using it!

    ReplyDelete
  2. How to make those colors? I'm trying to make some melting but its all same material. How did you made it so more hotter it is, color is lighter

    ReplyDelete


It's been a fairly busy few months at my "proper" job, so my recreational Houdini tinkering has taken a bit of a back seat. However, when I saw my Swarm Chemistry hero, Hiroki Sayama tweeting a link to How a life-like system emerges from a simple particle motion law, I thought I'd dust off Houdini to see if I could implement this model in VEX.

The paper discusses a simple particle system, named Primordial Particle Systems (PPS), that leads to life-like structures through morphogenesis. Each particle in the system is defined by its position and heading and, with each step in the simulation, alters its heading based on the PPS rule and moves forward at a defined speed. The heading is updated based on the number of neighbors to the particle's left and right. 

The project set up is super simple: 



Inside a geometry node, I create a grid, and randomly scatter 19,000 points across it. An attribute wrangle node assigns a random value to @angle:
@angle = $PI * 2 * rand(@ptnum); 
The real magic happens inside another attribute wrangle inside the solver.

In a nutshell, my VEX code iterates over each point's neighbors and sums the neighbor count to its left and right. To figure out the chirality, I use some simple trigonometry to rotate the vector defined by the current particle and the neighbor by the current particle's angle, then calculate the angle of the rotated vector. 
while(pciterate(pointCloud)) {

    vector otherPosition;
    pcimport(pointCloud, "P", otherPosition);

    vector2 offsetPosition = set(otherPosition.x - @P.x, otherPosition.z - @P.z);
    float xx = offsetPosition.x * cos(-@angle) - offsetPosition.y * sin(-@angle);
    float yy = offsetPosition.x * sin(-@angle) + offsetPosition.y * cos(-@angle);
    
    float otherAngle = atan2(yy, xx); 

    if (otherAngle >= 0) {
        L++;
    } 
    else {
        R++;
    }   
}
After iterating over the nearby particles, I update the angle based on the PPS rule:
float N = float(L + R);
@angle += alpha + beta * N * sign(R - L);
...and, finally, I can update the particle's position based on its angle and speed:
vector velocity = set(cos(@angle) * @speed, 0.0, sin(@angle) * @speed);  
@P += velocity ;
Not quite finally, because to make things pretty, I update the color using the number of neighbors to control hue:
@Cd = hsvtorgb(N / maxParticles, 1.0, 1.0); 
Easy!

Solitons Emerging from Tweaked Model



I couldn't help tinkering with the published PPS math by making the speed a function of the number of local neighbors:
@speed = 1.5 * (N / maxParticles);
In the video above, alpha is 182° and beta is -13°.

References

Schmickl, T. et al. How a life-like system emerges from a simple particle motion law. Sci. Rep. 6, 37969; doi: 10.1038/srep37969 (2016).


5

View comments

  1. ok. I've got to finish current job, then crash course in programming, and ... this is very inspirational!

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
About Me
About Me
Labels
Labels
Blog Archive
Loading