Ray Minimum Distance

ray_dist.gif
I remember when i start learning Houdini i come cross this blog i was really scare of it and keep saying there is no way i am going to do something like this soon, anyway recently i learn about xyzdist and primuv and i am really amazed about how many thing you can do so guess what come in my mind to try 😉 yes the old blog i mentioned earlier and this is how i did it.

1- first group the collide area.

houdini_B9YuL68Y92.png

2- create point wrangle and attach your object to input zero and the collision object to input one with this code and make sure this wrangle only effect the group we create in step one:

int hitprim;
vector hitprimuv;
xyzdist(1, v@P, hitprim, hitprimuv);

v@P = primuv(1, "P", hitprim, hitprimuv);

hindie_vbD4kkjv1Y.png

3- add smooth node to avoid hard edge if you wish, otherwise you are good and this is very much how i did it.

ray_dist.gif

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s