krot Posted December 22, 2009 Share Posted December 22, 2009 Hi guys How can i get a point attribute (of geometry A) containing distance to the closest point of geometry B? this need to be done in VOP SOP (using nodes, not coding). and how can i then modulate this attribute using a curve or a ramp? to fit it non-lineary in 0 - "cutoff distance" range. Thank you. Quote Link to comment Share on other sites More sharing options...
SpencerL Posted December 22, 2009 Share Posted December 22, 2009 short answer is to have a look at point clouds...there is loads of info on them in various posts on odforce and sesi as well as the help. You can extract the "distance" between your geo pts and your point cloud pts. Your geo pts would be Geo A and the points you feed into your point cloud will be Geo B. Quote Link to comment Share on other sites More sharing options...
itriix Posted December 22, 2009 Share Posted December 22, 2009 Here is a simple .hip file showing what you want. i documented everything in the stickies. Cheers, Jonathan pcloud_distance_lookup.hip Quote Link to comment Share on other sites More sharing options...
krot Posted December 22, 2009 Author Share Posted December 22, 2009 short answer is to have a look at point clouds...there is loads of info on them in various posts on odforce and sesi as well as the help. You can extract the "distance" between your geo pts and your point cloud pts. Your geo pts would be Geo A and the points you feed into your point cloud will be Geo B. thanks. i just can't get some details: 1. op:`opinputpath(".", 1)` - is this the right way to plug geometry in the vop sop's second port? 2. how do they use this "while loop"? Quote Link to comment Share on other sites More sharing options...
SpencerL Posted December 22, 2009 Share Posted December 22, 2009 thanks. i just can't get some details: 1. op:`opinputpath(".", 1)` - is this the right way to plug geometry in the vop sop's second port? 2. how do they use this "while loop"? 1. you can do two options, either write out your geo as either a .pc or .bgeo sequence (.pc are ideal for point clouds) and put the sequence into the pcOpen VOP > file parameter, or you can use the "op:" syntax which just reads the geometry in on the fly without writing out the sequence. "op:" is to point to the node you want to look up. ie "op:/obj/geo1/mySop". The `opinputpath(".", 1)` is just saying to look at the node being wired into the 2nd input, (ie 1 as the first input is 0). Either way will work. 2. Depending on what you are going for, you may not need to use a while loop as in Vops they take some getting used to. There is a vop called pcFarthest which returns the distance of the farthest neighbor to your Geo A point. Quote Link to comment Share on other sites More sharing options...
krot Posted December 22, 2009 Author Share Posted December 22, 2009 this is the thing) Thank you very much, itriix! Quote Link to comment Share on other sites More sharing options...
itriix Posted December 22, 2009 Share Posted December 22, 2009 (edited) you're very welcome. A couple things to note... on the vopsop the radius is set to 50... this is just a distance threshold for HOW far to look... so if you're spheres are a greater distance than 50 units radius away, then you will need to raise this value. Simply trying to find the distance to the nearest neighbor, you only need to do a lookup for the FIRST nearest point, therefore that's why the max points is only 1... if you start to do more complicated "FILTERED" based point cloud lookups, such as blending the colors of sphere2 to sphere1 - similar to an attributeTransfer SOP, with a setup that is similar to the setup i gave you, this won't work as expected because it simply would copy the value from the NEAREST neighbor to the point being calculated --> as in, there will not be any "BLENDING" of the values from point to point... You need to do a while loop to iterate over the points in the point cloud to get a blending.... In the examples you mentioned earlier, they detail this filtered based method very good for you. Hope this helps a bit... Jonathan Edited December 22, 2009 by itriix 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.