検索 - User list
Full Version: How to make normals follow the object in the scene
Root » Houdini Learning Materials » How to make normals follow the object in the scene
p0kerf4ce
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.
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);
p0kerf4ce
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
Mike_A
Happy to help : )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB