It is currently 23 Oct 2014, 02:36

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Some help with pointclouds and arrays
PostPosted: 29 Jul 2012, 21:50 
Offline

Joined: 07 Nov 2011, 19:44
Posts: 7
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


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 30 Jul 2012, 00:15 
Offline

Joined: 07 Nov 2011, 19:44
Posts: 7
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
distanceSorting.jpg [ 226.79 KiB | Viewed 1574 times ]
Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 30 Jul 2012, 02:45 
Offline
User avatar

Joined: 08 Jun 2009, 21:11
Posts: 1040
Location: Zagreb, Croatia
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.


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 30 Jul 2012, 13:43 
Offline

Joined: 07 Nov 2011, 19:44
Posts: 7
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.


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 30 Jul 2012, 17:00 
Offline

Joined: 07 Nov 2011, 19:44
Posts: 7
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
moveTowardsNewIndices.jpg [ 157.43 KiB | Viewed 1506 times ]
Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 30 Jul 2012, 23:28 
Offline

Joined: 07 Nov 2011, 19:44
Posts: 7
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
moveTowardsNewIndices2.jpg [ 225.65 KiB | Viewed 1471 times ]
Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 04 Aug 2012, 17:06 
Offline

Joined: 10 Feb 2012, 13:50
Posts: 29
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 !


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 04 Aug 2012, 20:56 
Offline

Joined: 10 Feb 2012, 13:50
Posts: 29
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


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 04 Aug 2012, 22:26 
Offline
User avatar

Joined: 08 Jun 2009, 21:11
Posts: 1040
Location: Zagreb, Croatia
btw if anyone is interested here is a few years old tutorial with animated ICE tree. Screenshot I've posted is from this tut.


Top
 Profile  
 
 Post subject: Re: Some help with pointclouds and arrays
PostPosted: 04 Aug 2012, 22:42 
Offline

Joined: 10 Feb 2012, 13:50
Posts: 29
That's super in depth ! Needs a little time to practice this. Thanks a ton Mathaeus :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group