csp Posted November 22, 2012 Share Posted November 22, 2012 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. point_normals.hip Quote Link to comment Share on other sites More sharing options...
sadhu Posted November 22, 2012 Share Posted November 22, 2012 Is this is what you want? point_normals_soln.hipnc Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 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. Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 (edited) 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 November 22, 2012 by cparliaros Quote Link to comment Share on other sites More sharing options...
sadhu Posted November 22, 2012 Share Posted November 22, 2012 (edited) If you have access to bended surface then attrib transfer is the simplest soln. Another soln attached point_normals_Vopsoln.hipnc Edited November 22, 2012 by sadhu Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 (edited) 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 November 22, 2012 by cparliaros Quote Link to comment Share on other sites More sharing options...
magneto Posted November 22, 2012 Share Posted November 22, 2012 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 Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 (edited) 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 November 22, 2012 by cparliaros Quote Link to comment Share on other sites More sharing options...
magneto Posted November 22, 2012 Share Posted November 22, 2012 (edited) 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 November 22, 2012 by magneto 1 Quote Link to comment Share on other sites More sharing options...
junaid Posted November 22, 2012 Share Posted November 22, 2012 yes I would do everything in VOP's, it will be bit faster and you could easily add more advance functionality. some thing like this in attachment. Quote Link to comment Share on other sites More sharing options...
junaid Posted November 22, 2012 Share Posted November 22, 2012 here is the attachment point_normals_0003.hipnc Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 here is the attachment 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. Quote Link to comment Share on other sites More sharing options...
junaid Posted November 22, 2012 Share Posted November 22, 2012 its quite confusing what you want, but whatever works for you ! Quote Link to comment Share on other sites More sharing options...
sadhu Posted November 22, 2012 Share Posted November 22, 2012 This will work. Separate component of the vectors, set x to zero and subtract y from y and z from z component. point_normals_FIXED.hipnc Quote Link to comment Share on other sites More sharing options...
csp Posted November 22, 2012 Author Share Posted November 22, 2012 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 Quote Link to comment Share on other sites More sharing options...
junaid Posted November 22, 2012 Share Posted November 22, 2012 like this ? Quote Link to comment Share on other sites More sharing options...
junaid Posted November 22, 2012 Share Posted November 22, 2012 like this? point_normals_0004.hipnc Quote Link to comment Share on other sites More sharing options...
edward Posted November 27, 2012 Share Posted November 27, 2012 ? 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.