herr.ja Posted March 22, 2023 Share Posted March 22, 2023 (edited) Helou houdini's folks! Just a superquick question. I am trying to define @Cd attribute, by distance from certain group of points. I am using pig head volume filled with points, and unfortunatelly I dont know, how to create black and white gradient, based on distance of selected group of inner points and outer points (explained in the attached picture). Can you guys help me out, please? (And additional question: is it possible to define it all at vop without selecting group of inner points previously?) I will be very thankful for any advces. Cd_distance.hipnc Edited March 22, 2023 by pan.mentolka Quote Link to comment Share on other sites More sharing options...
Ziyad Posted March 23, 2023 Share Posted March 23, 2023 Hi mate One approach would be to isolate the inside group and then use them in a nearpoint function to get the distance between them and outer points, so a bit similar to your original thought. If you want to avoid groups and just get gradient by distance to center of volume, you can extract the centroid of your volume as a point and use that in the same nearpoint setup. I've adjusted your hipfile here to show both approaches, hope this helps! Cd_distance.hipnc Quote Link to comment Share on other sites More sharing options...
animatrix Posted March 23, 2023 Share Posted March 23, 2023 Hi, If you have a VDB SDF, you can use it to do distance lookups using the volumesample function and set the gradient according to some signed distance range, i.e. -1 to 1, etc. Quote Link to comment Share on other sites More sharing options...
herr.ja Posted March 26, 2023 Author Share Posted March 26, 2023 (edited) Thanks guys! Both of you, I used Ziyads method. It was exactly what i was looking for Edited March 26, 2023 by pan.mentolka Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.