How to make normals follow the object in the scene

   1611   3   2
User Avatar
Member
2 posts
Joined: 3月 2025
オフライン
Good day. I have the next case; I need to face all normals to the target object. I'm using Scatter-> Attribute Wrangle and CopyToPoints. I want to make all points, that are scattered, face / look at the target object. I'm using the next code, but my case all points are facing to 0 local space, but not looking at the target object. What is the reason?

v@up={0,1,0};
vector targetObj = point("/obj/targets", "P", 0);
//vector targetObj2 = {-25,0,25};
@N = normalize(targetObj - @P);

PS. In case when I put in normalize a "targetObj2" the points are facing in the right direction.
User Avatar
Member
371 posts
Joined: 8月 2018
オンライン
Try this:

Use an 'Object Merge' SOP. Set 'Object 1' to the path to the target object.
Set 'Transform' to 'Into this object'.

Connect that SOP into the second input of the wrangle with this code:

v@up={0,1,0};
vector targetObj = point(1, "P", 0);
v@N = normalize(targetObj - @P);
User Avatar
Member
2 posts
Joined: 3月 2025
オフライン
Mike_A
Try this:

Use an 'Object Merge' SOP. Set 'Object 1' to the path to the target object.
Set 'Transform' to 'Into this object'.

Connect that SOP into the second input of the wrangle with this code:

v@up={0,1,0};
vector targetObj = point(1, "P", 0);
v@N = normalize(targetObj - @P);

Thank you very much, it worked
I'm just starting to get familiar with Houdini, so even some simple solutions are still difficult for me. So thank you for your help
User Avatar
Member
371 posts
Joined: 8月 2018
オンライン
Happy to help : )
  • Quick Links