PDA

View Full Version : Getting array of all ppoint positions in a cloud


mde
08-09-2008, 02:03 PM
I am trying to figure out how to get an array of all point positions (and velocities) in a cloud - I know it's basic question, but somehow I can't find it out by myself.

Edit:
Just to make the question clearer (hopefully) - what I get from GetData is a 3D vector per point (which is a point position)

What I want is array which contains all point position 3D Vectors for a cloud (static cloud with set number of points)

Hope that makes sense, I am still getting my head around how ICE handles data.
Thanks in advance!

ThE_JacO
08-10-2008, 06:33 AM
For something like ICE it's always more useful to know what you want to do rather than how you want to do it.
IE: Why do you need an array with all the positions/velocities?
Also, have you tried working with arrays at all yet? How far did you get and what didn't work with what you were trying to do?

mde
08-10-2008, 06:51 AM
For something like ICE it's always more useful to know what you want to do rather than how you want to do it.
IE: Why do you need an array with all the positions/velocities?
Also, have you tried working with arrays at all yet? How far did you get and what didn't work with what you were trying to do?

Thanks for reply Raffaele.

I need to be able to average, sum (and sort) etc.. positions and velocities of all points in a cloud. Arrays seemed to be the easiest way (not really after trying , but initially at least)

Arrays work fine for me, except I cannot find a good way to fill them with point data. The closest thing to what I am trying to do was getting an array of location using Get Closest Point node with no cutoff. That kind of worked.

grahamef
08-11-2008, 11:21 AM
At the moment, there is no way to do that. You cannot convert a set of attributes in a component context to an array in the object context.

However, you might find some of the nodes in the Math/Statistics category useful for getting the min, max, average, etc. in a set.

What is the final effect you want to achieve? There may very well be a way to approach it without using arrays.

kim aldis
08-11-2008, 04:38 PM
it's a bit of a hack but how about the GetNeighbouringParticles node with a huge radius?

mde
08-11-2008, 06:10 PM
it's a bit of a hack but how about the GetNeighbouringParticles node with a huge radius?
Yes, that worked, also I am experimenting with statistics nodes (thanks Grahame, for some reasons I missed these and they are really useful) and having good results.

I am trying to implement simple flocking algorithm as an exercise/learning thing.

My real problem was getting my head around the fact that what you get from get data/point position is a set. ICE requires different way of thinking, at least for me ;)


Thanks a lot everyone, very helpful answers!

kim aldis
08-12-2008, 02:06 AM
i'll be doing a tutorial on this shortly but getneighbouring particles is exactly what you need. Your flocking algorithm only needs to look at close particles within a view cone.

mde
08-12-2008, 11:59 AM
i'll be doing a tutorial on this shortly but getneighbouring particles is exactly what you need. Your flocking algorithm only needs to look at close particles within a view cone.
Yes, Get Neighbouring Particles node worked just as I wanted.

Can't wait for your tutorial!

mde
08-27-2008, 05:28 AM
I finally found some time to finish this exercise

http://www.vimeo.com/1613365

Thanks everyone for pointing me in correct direction!

By the way I simulate over 1000 particles and it still plays mostly real time.. on my q6600 machine.