Creating a colorful “heat map” based on geo deformation?

   1453   1   1
User Avatar
Member
1 posts
Joined: April 2019
Offline
I'm relatively new to Houdini and I think what I want to do here is fairly simple. Can someone please share with me a solution for this?

Let's say I have a sphere and another object is animated to push into the sphere, creating an indentation on the sphere's surface. I ended up with an alembic cache of the non-deformed sphere and one of the animated/deformed sphere.

What I'd like to generate is a multi-color “heat” map that changes in the areas of deformation based on how far away from the “rest” shape it has deformed.

I'm assuming we can compare the two meshes and color the points based on how far they move from their starting point?

Thanks in advance!
User Avatar
Member
11 posts
Joined: May 2017
Offline
Hello, I believe your whole assumption is very correct.
Assuming your topology remains unchanged in terms of point count, if you pipe your resulting deformed sphere to a wrangle and the original one to its second input (or vice-versa, really), the code below calculates the distance from their points positions. All you have to do is wire this value to a ramp, and write it to the @Cd attribute.

float dist = distance(@P,point(1,"P",@ptnum));
@Cd = chramp("ramp", dist);
  • Quick Links