Jump to content

point normals pointing away


csp

Recommended Posts

Hi all,

I have a group of points from a grid geometry and I want as they are bend to have their normals pointing away perpendicular to their points of the neighbour rows. I can't use edge_dir because there are no edges just points. I have attached two images, the first is the points as result of the pending and the second is just a cylinder but demonstrate has the normals I want them to be.

I have also attached a hip file.

post-5813-0-12369000-1353586919_thumb.pn

post-5813-0-19020400-1353587774_thumb.pn

point_normals.hip

Link to comment
Share on other sites

Is this is what you want?

Thanks for your reply sadhu. Yes this is end result I am after but in the original scene the bending has to happen on the points, there is no surface. that's why I had the nodes in this order.

Link to comment
Share on other sites

I found one way to fix it but is very messy, I have the same process with the bending on the points and repeated on the original surface and then I transfer the normal attribute from the second to the first with an attribtrasferSOP. They dont have for both groups to have the same points. Is there any other more clean and efficient way?

Edited by cparliaros
Link to comment
Share on other sites

If you have access to bended surface then attrib transfer is the simplest soln. Another soln attached

thanks that works great.

EDIT: I just realized when I scaled up the normals that they are not right in your approach because they are pointing away from the center of the group of points not from each point. I guess I have to go back to attribute transfer solution. cheers.

Edited by cparliaros
Link to comment
Share on other sites

If I understand you correctly, just subtract the center from the point positions in a point SOP like:

NX = $TX - $CEX

etc

After that you have to normalize them so you can do it in a VOPSOP, or just do the whole thing VOPs, using the Bounding Box VOP to calculate the center and then do the same. That's probably what I would prefer :)

Link to comment
Share on other sites

well not exactly, this way you have the same result as sadhu latest example where all the normals point away for the center of the object. I have attached a scene with the two ways to attemot fix this. the first named "magneto" I have what you described in the other named "cparliaros" I have my messy fix which gives the correct results.

point_normals_0002.hipnc

Edited by cparliaros
Link to comment
Share on other sites

I see what you wanted. If the points are ordered, it's easy to do.

All you need to do is in VOPs (pseudo-code):


d = (importattib (ptnum+1) "P") - (importattib ptnum "P")
N = normalize(cross(d, {1,0,0)))
[/CODE]

For the last point, since it doesn't follow the flow of points in one direction, you could copy and mirror it from the first one.

Edited by magneto
  • Like 1
Link to comment
Share on other sites

here is the attachment :P

sorry man but you are getting the same results as sadhu last example.

I see what you wanted. If the points are ordered, it's easy to do.

All you need to do is in VOPs (pseudo-code):


d = (importattib (ptnum+1) "P") - (importattib ptnum "P")
N = normalize(cross(d, {1,0,0)))
[/CODE]

For the last point, since it doesn't follow the flow of points in one direction, you could copy and mirror it from the first one.

its really close to what I am getting with the attribtrasfer but they are not that accurate besides the last point. I will probably do it in vopsop using pointcloud which actually simulates the attribtransferSOP but is faster.

thanks for all the replies.

Link to comment
Share on other sites

This will work.

Separate component of the vectors, set x to zero and subtract y from y and z from z component.

well I think is my mistake that I used this example with that amount of bending. With your fix and junaid's fix, if your change the strength in the twistSOP in something less or more, you will see that the normals will not look right any more. The center point is useful when the object is rounded.

cheers guys

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...