| View previous topic :: View next topic |
| Author |
Message |
vigneshkaushik Lurker
Joined: 06 Sep 2010 Posts: 10 Location: singapore

|
Posted: Sat Feb 18, 2012 8:02 am GMT Post subject: unique selection of primitives |
|
|
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
| Description: |
|
 Download |
| Filename: |
programrelationship.hipnc |
| Filesize: |
85.87 KB |
| Downloaded: |
39 Time(s) |
_________________ Cheers
ViSiKa |
|
| Back to top |
|
 |
tamte Houdini Master
Joined: 16 Jul 2007 Posts: 1007 Location: Slovakia, Bratislava

|
Posted: Sat Feb 18, 2012 9:10 am GMT Post subject: |
|
|
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
| Description: |
|
 Download |
| Filename: |
programrelationship_rand.hipnc |
| Filesize: |
88.77 KB |
| Downloaded: |
38 Time(s) |
_________________ Tomas Slancik
Generalist
Slovakia |
|
| Back to top |
|
 |
vigneshkaushik Lurker
Joined: 06 Sep 2010 Posts: 10 Location: singapore

|
Posted: Sat Feb 18, 2012 9:41 am GMT Post subject: |
|
|
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 |
|
| Back to top |
|
 |
asnowcappedromance Houdini Expert
Joined: 15 Jul 2009 Posts: 489 Location: Vancouver

|
Posted: Sat Feb 18, 2012 3:45 pm GMT Post subject: |
|
|
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
Manuel Tausch
Senior FX TD - Rhythm & Hues Vancouver |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
|