Variable Radius with Point Cloud functions

   3181   7   1
User Avatar
Member
4 posts
Joined: June 2010
Offline
Hey everyone,
This question has been one I have had for quite a while, but never found an answer. Does anyone have any suggestions on how to create something like the attached image?

Basically, point cloud functions take a radius, but this refers to the geometry sampling the point cloud. How would one sample different points in a point cloud and create the appearance that those points had different radii?
I am familiar with using point cloud vops, just can't get this result.

If the smooth interpolation is causing issues, then don't get stuck on that, I can refine from a basic 0/1 result.

Thanks so much for any help

Attachments:
pointCloudQuestion.jpg (66.5 KB)

User Avatar
Staff
6209 posts
Joined: July 2005
Offline
pcfind_radius() in VEX, “Point Cloud Find Radius” in VOPs. You can set your search radius to 0.0, relying on the pscale of the target cloud.

Then, after finding the points, use the point() VEX function or Import Point Attribute VOP to fetch the pscale of the point. Then it is a simple matter of taking your distance to the point and scaling by the pscale.
User Avatar
Member
4 posts
Joined: June 2010
Offline
Brilliant brilliant brilliant!
Thanks so much that works like a charm.
I guess no one else ever asked, since it is so easy.
User Avatar
Member
4517 posts
Joined: Feb. 2012
Offline
Is this the right approach?
int pts = pcfind_radius ( 1, “P”, “pscale”, 1, @P, 0, 1 );
vector newcolor = 0;

foreach ( int pt; pts )
{
vector color = point ( 1, “Cd”, pt );
float pscale = point ( 1, “pscale”, pt );
vector p = point ( 1, “P”, pt );
float dist = distance ( @P, p );
float s = fit ( dist, 0, pscale, 1, 0 );
newcolor += color * s;
}

@Cd = newcolor;

I am getting artifacts between areas of small and large pscales:

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
4 posts
Joined: June 2010
Offline
I built my network in VOPs, but could it be due to the fact that your maxpoints argument in your first line is one point?
int pts = pcfind_radius ( 1, “P”, “pscale”, 1, @P, 0, 1<maxpoints);

Try increasing that number to better reflect the number of points that may be sampled by a given point.
User Avatar
Member
4517 posts
Joined: Feb. 2012
Offline
Yeah higher values for max points works better but AttribTransfer doesn't seem to have this issue when the Max Sample Count is set to 1.

I faked the variable radius for that by moving the points above the grid by pscale.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
4 posts
Joined: June 2010
Offline
If attribute transfer with offset points does the trick for you, then it is indeed the faster option. I needed more control for the final effect, I just was hung up on this one part of the setup.
User Avatar
Member
4517 posts
Joined: Feb. 2012
Offline
No I used it for comparison. I want to have a custom VEX implementation as this trick will be hard to do with non-flat surfaces and I have a few other features that are not available in AttribTransfer.

I will investigate more as time permits.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
  • Quick Links