unique selection of primitives

   2880   3   1
User Avatar
Member
20 posts
Joined: Sept. 2010
Offline
hi,

attached is the .hip file. it contains a node called GENOTYPE. this node selects 64 primitives from a pool of 1000 primitives. however, im unable to find a solution to make it a unique selction for all the 64 primitives. for eg. all the 64 prim must take unique positions within the pool of 1000 and must not overlap. how to do this??

Pls help me with this problem!! thanks a tonne!

cheers
vignesh kaushik

Attachments:
programrelationship.hipnc (85.9 KB)

Cheers
ViSiKa
User Avatar
Member
8506 posts
Joined: July 2007
Offline
is that selection purely random?
for now you have 64 parameters which you can set up individually so it's up to user to fill in unique numbers

but if you want just unique 64 random values out of 1000 you can look at this altered file, there is also seed parameter on orange node to get different 64 unique prims

Attachments:
programrelationship_rand.hipnc (88.8 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
20 posts
Joined: Sept. 2010
Offline
thanks a lot for your input. however, this is not exactly random. it starts with a random population which the user defines. but then the algorithm will change the value, evaluate it, then again change value and evaluate it in an evolutionary process, until it satisfies my evaluation criteria. so it is imperative that i dun end up with a random selection everytime, then i wud not be anywhr close to the solution.

Hence when the algorithm alters the GENOTYPE node, there shouldnt be any overlapping selection. all the 64 genes must have unique number. is thr a way for the GENOTYPE node to check itself for its unique gene_no??

thanks a bunch!
Cheers
ViSiKa
User Avatar
Member
512 posts
Joined: July 2009
Offline
I'm not exactly sure what you're after,
but you could evaluate those gene numbers in a Python script to see if they're unique or not. I'd create an empty list and do a simple if statement, i.e. if i not in list(): to append 64 random values in order to fill it. You could also create another argument to only append primitives that are not within a certain distance of the primitives that are already in the list, in order to avoid overlapping faces.

regards,

Manu
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
  • Quick Links