Some help with pointclouds and arrays
Posted: 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
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