Transfer Attributes with Normal Direction

   1196   2   1
User Avatar
Member
48 posts
Joined: Aug. 2015
Offline
How can I transfer attributes from a normal direction. For example, if I draw a line on a grid and have the normals pointing off to one side of the line, then how can I tranfer attributes from the line to the grid on the side that the normals are facing? I hope that makes sense, I've attached an image as an example. I'm thinking maybe a dot product?

Attachments:
color.png (494.0 KB)

User Avatar
Member
5 posts
Joined: May 2021
Offline
Dot product would be a great start. I would generate a mask or a group using the dot product then drive your attribute transfer from that.
User Avatar
Member
4685 posts
Joined: Feb. 2012
Offline
Hi,

You can create a mask using the dot product and then use that mask after attribute transfer to tweak the result:

Mask by Normal (Point Wrangle):
vector n = normalize ( @P - v@pos );
float d = dot ( n, normalize ( v@dir ) );
@mask = fit ( d, ch("min"), ch("max"), 0, 1 );

Apply Mask (Point Wrangle):
@near *= @mask;

near pos (Point Wrangle):
@near = 1;
v@pos = @P;

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links