Some help with pointclouds and arrays

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
stevegh
Posts: 7
Joined: 07 Nov 2011, 19:44
Skype: stevegh2817

Some help with pointclouds and arrays

Post by stevegh » 29 Jul 2012, 21:50

Hey all,

I have a fair understanding of how ICE works and how to use it but in this particular case I am struggling to figure out how to get this to work. Here is what I'm after:

I have 2 point clouds, 1) a volume of points that don't move, which I will refer to as targetPoints, and 2) a point cloud with the same number of points as targetPoints that gets emitted and moves toward targetPoints which I will refer to as movingPoints. What I want to do is sort the points of targetPoints based on the distance to a null, and have movingPoints use that order as their goal. In addition I want to have movingPoints order themselves based on when they enter a sphere.

So a sphere moves across movingPoints, these points are given a goal based on the order of targetPoints as they enter the sphere.

What I've tried was to get the distance to a null, create an index array and sort the index array based on the sorted distances, and then grab the index of that array with a select in array, but this didn't sort my points correctly. I feel once I get that figured out adding the goals to the movingPoints as they enter a sphere should be a little more straightforward but any help on that beforehand would be awesome.

Thanks!
-S

stevegh
Posts: 7
Joined: 07 Nov 2011, 19:44
Skype: stevegh2817

Re: Some help with pointclouds and arrays

Post by stevegh » 30 Jul 2012, 00:15

OK, perhaps a simpler problem to attack first. I have the distances for each point, and the ID of each point. I want to sort the IDs according to the distances. Now since the ID is a reserved attribute, I'll just throw this into a new attribute called Index. So I build 2 arrays from sets, sort the Index array with the distances array as the key, but the numbers aren't lining up. I've attached an image, hoping it helps. Indices are in green and distances are in blue.
Attachments
distanceSorting.jpg

User avatar
Mathaeus
Posts: 1660
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: Some help with pointclouds and arrays

Post by Mathaeus » 30 Jul 2012, 02:45

if I understand what you mean, one way could be something like this one. Image is a few years old, today you'll be using 'build array form set' instead a few nodes on the left side. It sorts by UV from emit location, not big deal to replace this by distance.
The renderer "turtle" used by this scene, is not currently available. The "turtle" renderer will be used instead.

stevegh
Posts: 7
Joined: 07 Nov 2011, 19:44
Skype: stevegh2817

Re: Some help with pointclouds and arrays

Post by stevegh » 30 Jul 2012, 13:43

Booya! Works perfectly even as you have it setup, not using build array from set. Thanks Mathaeus! On to the next issue to solve but this was the big one for me so far.

stevegh
Posts: 7
Joined: 07 Nov 2011, 19:44
Skype: stevegh2817

Re: Some help with pointclouds and arrays

Post by stevegh » 30 Jul 2012, 17:00

Alright onto the next problem related to my limited understand of how ICE works. So I have my target point cloud, and the new sorted Index values stored into the SortedIndex attribute. I am trying to simply emit particles and have their goals be set in that new order, but some really unexpected behavior is showing up. How far off am I?
Attachments
moveTowardsNewIndices.jpg

stevegh
Posts: 7
Joined: 07 Nov 2011, 19:44
Skype: stevegh2817

Re: Some help with pointclouds and arrays

Post by stevegh » 30 Jul 2012, 23:28

I have no idea if anyone is following this but I was easily able to fix the previous problem with the following tree on my targetPoints clouds:
Attachments
moveTowardsNewIndices2.jpg

olivier jeannel
Posts: 30
Joined: 10 Feb 2012, 13:50

Re: Some help with pointclouds and arrays

Post by olivier jeannel » 04 Aug 2012, 17:06

Fantastic !
I wanted to do this in an older project, but wasn't able to get it proper. You solved it !

Really a big thank you !

olivier jeannel
Posts: 30
Joined: 10 Feb 2012, 13:50

Re: Some help with pointclouds and arrays

Post by olivier jeannel » 04 Aug 2012, 20:56

So I allowed myself a little pleasure, putting this on vimeo.
Let me know if it is ok for you. Do you mind If I share it if I'm asked to ?

Thank you

User avatar
Mathaeus
Posts: 1660
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: Some help with pointclouds and arrays

Post by Mathaeus » 04 Aug 2012, 22:26

btw if anyone is interested here is a few years old tutorial with animated ICE tree. Screenshot I've posted is from this tut.
The renderer "turtle" used by this scene, is not currently available. The "turtle" renderer will be used instead.

olivier jeannel
Posts: 30
Joined: 10 Feb 2012, 13:50

Re: Some help with pointclouds and arrays

Post by olivier jeannel » 04 Aug 2012, 22:42

That's super in depth ! Needs a little time to practice this. Thanks a ton Mathaeus :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest