Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / ICE - Interactive Creative Environment / Provide ID to particle in a specific order
  RSS 2.0 ATOM  

Provide ID to particle in a specific order
Rate this thread
 
28895
 
Permlink of this thread  
avatar
  • Total Posts: 4
  • Joined: 25 April 2009 10:39 PM

Sorry if this as been answer before, but I did not find any information about it.

I have sorted my particles by Y value from the lowest one at 0 and the highest one at 1. Now, I would like to have integer id using that order for every particles. If I have 10 particles, I would like to have the lowest one be 1 and the highest one be 10 and have all integer id in between.

Does anyone know a clever way to do this?
Thanks.



Attachment Attachment
Replies: 0
avatar
  • Mathaeus
  • Posted: 26 April 2009 12:22 AM

If I understand correctly, that may be rescale from 0-1 to 1-10, round to integer, convert back to scalar if you need.



Replies: 0
avatar

Unfortunatly, no.  The 1 to 10 exemple was just to demonstrate my problem.  If you look in the image, their are particles with values as close as 0.0039 and 0.0085.  Rounding is not a solution.

For now, I am using iteration to provide ID to particles within ranges.  I can have layers of particles that way, but it is pretty uggly.  I hope to find a better solution that can be boil down to every particles.

Thanks anyway.



Replies: 0
avatar
  • CiaranM
  • Posted: 27 April 2009 04:05 AM

Hi there,
if I understand correctly, you could use ordered arrays for this type of thing. Be warned though, I’ve found arrays, particularly ‘find in array’ to be pretty slow if you have many particles.



Attachment Attachment
Replies: 0
avatar

Wow!  This is so much cleaner than anything I could come up with.  This is exactly what I was looking for.  Thanks a lot CiaranM!



Replies: 0
avatar
  • CiaranM
  • Posted: 27 April 2009 05:11 AM

No problem!



Replies: 0