Search - User list
Full Version: Random selection of adjacent polygons in a grid
Root » Houdini Indie and Apprentice » Random selection of adjacent polygons in a grid
RFraser
Hi Houdini people
First posting so apologise if I missundersatnd anything.

I am trying to create a random selection of adjacent polygons on a grid. I am getting exactly what I need by generating the random input from the frame number (see attached RandomGridSelect_byFrame.hiplc).

However, as this is going to be part of an HDA in Unreal, what I need is for the random input to not be based on the frame number but rather on a randomly generated number on a slider.

I have created a version using an Attribute wrangle node but it is not selecting only adjacent polygons.

float seed = rand(ch("seed"));
float thresh = ch("threshold");
float rand_selection = rand(i@class + seed);

if(rand_selection < thresh)
{
i@keep = 1;
}

Ultimately what I am trying to achieve is the random selection of only adjacent primitives in a grid (see attached RandomGridSelection.jpg) so no only touching by corners and no isolated selections.

I have looked on-line and even tried chatGPT (that was a complete waste of time, the thing is an idiot!)

Any advice greatly received

THankyou
cncverkstad
play with this
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB