How to stop the tips of skinned spikes from intersecting?

   1136   2   2
User Avatar
Member
1 posts
Joined: March 2022
Offline
I'm looking for a non-sim solution for intersection avoidance for shortish spikes around areas of a character that will deform (ie elbows, neck etc).

I'm coming from Maya, so may use the wrong terms with apologies, but I'd like something that would be aware of the location of the tips of the spikes in relation to the skinned surface and the distance between them, so they don't ever overlap.

Meaning the tips don't intersect but compress together.
Think of it as pushing your thumb into a plastic hairbrush and tips cluster together instead of criss-crossing each other.



It'd need to be procedural so we can feed in different characters, and ideally something we can use in Maya via Houdini engine.
We'd want to put base-points of spike and tips into tuples, but not manually as there will be hundreds of them

I'm looking for pointers on any nodes that already exist that may help this (ie intersectionanalysis?) or a method to iterate over a group of tips, perhaps getting its distance and angle at bind and moving them away.

Something like a loop perhaps:

for each other tip within x distance of tip:
    if closer than the bind position: 
        move tip along vector away from point.

Simplified:
Three spikes are 90' pyramids on a flat three-face plane viewed from the side.
The third face pivots toward the other two so that normally the spikes would intersect, but Houdini rotates the second spike to the left (its pivot at the skin surface) and the right spike to the right, so they never collide.

We don't have the capacity to simulate/cache this across all characters, so it'd need to iterate over the points on frame update.

Is this even possible?
Where would I start? The solution could include hiring a Houdini TD who can do this.
Thanks!
User Avatar
Member
398 posts
Joined: Nov. 2016
Offline
Thinking out loud, but you could probably use a ray node on the tip of your spikes, in the direction of the root. If the spike intersects, the tip will be projected back to the surface. Then calculate the distance between root and tip, and use it to blend between normal and squashed shape.
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
Have you tried the point relax sop? If both the spikes and the skin have a pscale attribute, and you toggle on "Relax in 3d space" it might work (althought it won't know what's "inside" and what's outside so it may avoid to the wrong side). Problem will be that it will snap (it's not a sim) so it will not bounce back nicely. You could of course bring these points into CHOPs to smooth this out.

Failing that, you can use this code to push your geo out of a volume (this code stolen from someone on this forum a long time ago, sorry I can't find original author):

// calculate the volume's gradient
vector grad = volumegradient(1, 0, @P);


// See how far into the volume the geometry is
float dist = volumesample(1, 0, @P);


// if the geo is inside the volume, move it along
// the volume gradient the value of the distance
// inside the volume

if(dist <= 0)

    @P -= normalize(grad) * dist;
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
  • Quick Links