magneto Posted August 14, 2012 Share Posted August 14, 2012 Hi, I am trying to experiment with point clouds in VEX, since it feels easier to loop, etc in code than in VOPs. Are there any examples that you know of that shows a simple search using a radius and then importing an attribute from each of these found points, and doing something simple with them? If I get the correct syntax and usage, I can manage from there. Thanks Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted August 14, 2012 Share Posted August 14, 2012 Hi, I am trying to experiment with point clouds in VEX, since it feels easier to loop, etc in code than in VOPs. Are there any examples that you know of that shows a simple search using a radius and then importing an attribute from each of these found points, and doing something simple with them? If I get the correct syntax and usage, I can manage from there. Thanks I think vex coding and point cloud operations are used a pretty good amount in this tutorial http://www.cmivfx.com/tutorials/view/330/Houdini+Flocking+Systems Lemme know if want I could send you some of the code. Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted August 14, 2012 Share Posted August 14, 2012 Or you could create a vopsop doing roughly what you want and then right click on the vopsop and press "view vex code" (or something like that) which should might give you a good idea of where to start. Quote Link to comment Share on other sites More sharing options...
magneto Posted August 14, 2012 Author Share Posted August 14, 2012 Thanks John. I haven't used point clouds before so PC VOPs aren't easier for me I have that dvd, so will check that out. Quote Link to comment Share on other sites More sharing options...
ikarus Posted August 14, 2012 Share Posted August 14, 2012 Check out the source files for Peter Quint's point cloud tutorials. It contains a vop with a custom pc loop, which you could just view in vex code. https://sites.google.com/site/pqhoudinitutorial/home/houdiniprojectfiles afaik: A pc iteration loop is a pc open attached to a while loop that contains a PC iterate connected to the while condition. PC import is used to retrieve attributes from individual pc sample points. 2 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 14, 2012 Author Share Posted August 14, 2012 Thanks ikarus, I will check out Peter Quint's tutorials. I made some headway yesterday. But the "maxpoints" parameter confuses me. Is it the maximum number of points returned for each point, or the total number of all points that will be returned for the whole VEX operation (for all points)? Is there a way to specify "return as many as you can find"? Like if there are points within the search radius for each point that ranges from 0 to 120, I want to get all of them since I already specified a search radius. Am I thinking wrong? Quote Link to comment Share on other sites More sharing options...
anim Posted August 14, 2012 Share Posted August 14, 2012 maxpoints and radius are limits for poincloud query, they are both active all the time so if you want all points within specified radius set maxpoints to extremely high number like 1e9 and similarly if you want lets say closest 10 points set maxpoints to 10 and radius to extremely high number btw, if you want exact number of points pointcloud query has returned for current point you can use pcnumfound() function (Point Cloud Num Found VOP) also search forums for pointclouds there is plenty of examples of iterating through pointclouds in VEX, VOPs, using While Loop, For Loop, No loop at all, in many different scenarios, I think forums are the best resource for this you can find 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 14, 2012 Author Share Posted August 14, 2012 Thanks anim. So the points are returned by distance, from closest the furthest? I thought the order of points weren't guaranteed to be sorted by distance. I saw the pc num found VOP, but since I can't feed it back to pc open, I didn't use it. Quote Link to comment Share on other sites More sharing options...
anim Posted August 14, 2012 Share Posted August 14, 2012 I didn't say that the points are ordered, I don't consider it guaranteed either, but they are returned based on proximity to point so it will return closest maxnum of particles from within specified radius pcnumfound() returns number of particles which met the conditions of pcopen, so pcopen handle is meant to be plugged in no other way around (even though you can plug it to another pcopen if you desire so) the returned number can be used to loop with the for loop since you know how many points were found (here is one example for that: http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=121576#121576) 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 15, 2012 Author Share Posted August 15, 2012 Thanks anim. I misread what you wrote previously, but now it's clear Quote Link to comment Share on other sites More sharing options...
bunker Posted August 15, 2012 Share Posted August 15, 2012 have a look at the pc filter function 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted August 15, 2012 Author Share Posted August 15, 2012 Thanks bunker. That's an interesting function. I ended up with a similar code looping wise 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.