particles attract to each other

   28443   21   9
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
i want to achieve this kind of effect
http://youtu.be/pP-C_B8nSmw?t=56s [youtu.be]
basically i dont know how to find, for example, three nearest points of each point in same pointcloud.
in Softimage there is compound which do exactly what i want.
how it is possible to do in VOP POP?
i need to find average position of three nearest points of the same pointcloud.
can someone provide a little example file?
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
nothing?
come one, Houdini Gurus, help me!
User Avatar
Member
1743 posts
Joined: 3月 2012
Offline
There's undoubtedly a good solution, but I've never used POPs or VOPs, so I can only think of terrible solutions. :wink:

I'd really like to see this, though, ‘cause Houdini would be *much* better suited to it than After Effects; so much so that someone’s probably already done this for fun in a few minutes.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
basically i dont know how to find, for example, three nearest points of each point in same pointcloud.

I really do not see what purpose it would solve.
For people to help you a bit of self help is required as I am sure not everyone has the time to do your entire homework. For starters I would look at creating 1 point and have a lot of points / buzz move around it and that would be as simple as some points scattered in a volume couple with some noise for movement .

Rob
Gone fishing
User Avatar
Member
1743 posts
Joined: 3月 2012
Offline
circusmonkey
basically i dont know how to find, for example, three nearest points of each point in same pointcloud.

I really do not see what purpose it would solve.
For people to help you a bit of self help is required as I am sure not everyone has the time to do your entire homework. For starters I would look at creating 1 point and have a lot of points / buzz move around it and that would be as simple as some points scattered in a volume couple with some noise for movement .

Rob
Even though I suppose it's possibile that qbick's specific question could have come from homework, the thing qbick linked to isn't homework, and creating points moving with random noise doesn't appear to be the point. The link is to a YouTube video by Minute Physics showing a 2D particle-based gravity simulation in After Effects. In order to make such a simulation both scalable and stable, one would need to use various tricks, e.g. avoiding computing the forces between all pairs of particles, since doing it naively takes quadratic time and explodes if two particles get too close.

If there's concern that something is an excuse to get homework answers, I usually try to give advice that would help learning about the overall problem in a different way, but that wouldn't help at all solving the specific question asked. :wink:
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
Oh my God..
I just know how to do it in Softimage and dont know how to do it in Houdini.
Im trying to learn Houdini by replicating stuff im able to do in Softimage.
User Avatar
Member
49 posts
Joined: 1月 2007
Offline
Try looking at pcopen and pcfilter. They will look-up a point cloud, and give you what you're after. Here is some info on that:

http://www.msawtell.com/research/point_clouds/point_clouds.shtml [msawtell.com]
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
Just finding the nearest three points to each point is done with point clouds. See the attached file for one solution where the nearest points are returned as a list of attributes and then the nearest points are connected to each other with line segments (thanks Mr Dan Bodenstein for the file).

That part is straight forward but as was eluded to by ndickson, you want to now rotate clusters of points around a given subset of points.

You can easily create that subset if you have static “id” attributes for the points. Just use a Delete SOP to delete by range and say delete 1 out of 20 and then compute nearest points to this subset and apply the appropriate forces to create localized orbits. Or use a Fuse SOP and consolidate points

To have each point orbit with it's nearest neighbour, where are the rotate centroids? What happens when one point flings farther from it's nearest neighbour so that it isn't the nearest neighbour any more?

I have built such a system and what it looks like is exactly how I described it in the previous paragraph: white noise.

Btw what compounds are you referring to? The emFlock compounds?

Attachments:
Nearest_Neighbor_01.hip (246.9 KB)

There's at least one school like the old school!
User Avatar
Member
379 posts
Joined: 12月 2006
Online
Btw what compounds are you referring to? The emFlock compounds?

Yeah I was wondering the same.
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
i dont have Softimage instaled at this moment, but as i remember its Get Neighboring Particles node.
after neighbors are found, im subtracting founded positions with particle self positions.
abter that im multiplying that on particles's mass which is generated with turbulence node.
result is connected to particles velocity
thats nothing difficult except that when im trying to replicate this in Houdini - nothing works.
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
The file I attached just gets the nearest point numbers which is far more involved than what you are now requesting (which should have been made clear in the first post imho).

Point clouds were explicitly designed to return weighted distance values of neighbouring points. Please see the Peter Quint Vimeo vids on point clouds. He covers in depth what you are looking for after having a look at the point cloud example files in the help and the numerous posts here on this and the OdForce forums on point clouds.

If not, I can whip up an asset to do this for you.
There's at least one school like the old school!
User Avatar
Member
606 posts
Joined: 5月 2007
Offline
For another approach, a volume acceleration structure for gravitational sims, check http://forums.odforce.net/index.php?/topic/8471-eetus-lab/page__st__72#entry91453 [forums.odforce.net]

One small caveat, it is fundamentally flawed Particles inside the same voxel exert 0 force on one another, where in reality that's when the pairwise forces should be the greatest. I should find all the points inside the same voxel, and calculate their pairwise forces naively.
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
here you go, basic approach on Softimage.
http://clip2net.com/s/2oXCD [clip2net.com]
almost impossible for me to replicate in Houdini.
User Avatar
Member
1743 posts
Joined: 3月 2012
Offline
qbick
here you go, basic approach on Softimage.
http://clip2net.com/s/2oXCD [clip2net.com]
almost impossible for me to replicate in Houdini.
It's probably just me misunderstanding your SoftImage nodes, but it looks like you've implemented some sort of spring force instead of a gravitational force. The force of gravity scales as mass_a*mass_b/distance^2, whereas spring forces scale as k*distance, for some k, which appears to be chosen to be mass in your example.

The “/distance^2” is part of what makes many-body gravitation so hard to simulate reliably, because when two points are very close, the force is extremely large, but only for a brief amount of time, so special methods are needed to conserve energy. Spring forces aren't as difficult to simulate, because they don't have that singularity at distance zero.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
102 posts
Joined: 3月 2012
Offline
i not chasing idea of correct gravitational force behavior.
i just want to replicate this example in Houdini.
THATS ALL.
im not asking if this implementation is correct, im trying to learn houdini by just doing simple stuff that i was able to do in softimage.
and if someone provide me the scenefile with proper working particle system - it would be awesome.
but for now guys i havent get any help from you.
sorry for being rude - my small vocabulary is forcing me to talk a little stiff :?
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
Thank-you for the image of the ice tree. Explains everything actually, in a couple seconds.
Next time don't be throwing us a wrench by showing us what you want (http://en.wikipedia.org/wiki/Accretion_(astrophysics) [en.wikipedia.org] and http://en.wikipedia.org/wiki/Galaxy_formation_and_evolution, [en.wikipedia.org] etc.) then asking for something completely different. Just the ice tree at the start and nothing else could have shortened this to just two posts.

Finally had a few minutes to whip up a file for you. See the attached hip file for one way of implementing this in Houdini using POPs inside of a DOP network.

It builds the POPs inside a DOP network allowing the point cloud oppath_to_sop syntax work as expected fetching the previous cached frames result inside a SOP Solver only used to point to this cache (which you can do whatever you want to inside btw).


The first part of the ice tree is about getting the average position around the current point and NOT the nearest 3 points specifically. I gave you a file above that lets you get the nearest 1st, 2nd, 3rd, 4th, Nth point around the current point.

This is EXACTLY what Point Clouds were designed to do: Find the average attribute weight around the current position P. In the given Ice tree, it returns the AVERAGE of the array of Point positions and not the point indices themselves, as you requested and as I delivered. Unlike the ice tree which takes 6 or 8 nodes to do, it is done with just two VOPs and no loops as this is an iconic technique:

Point Cloud Import VOP
Point Cloud Filter VOP

The Point Cloud Filter VOP in the example finds the average vector P position around the current point and you can set the number of nearest search points to 1, 2, 3, 4, 10000 if you so wish all within a given radius again if you so wish.

That again isn't the driving force with this set-up as exposed in the ice tree.

The real motivation provided by the ICE tree isn't the fetching of the average weighted P. As I stated very clearly in a previous post, this gives you random white noise like behaviour.

It's the Randomize Around Value ICE node that is setting things in motion giving the sim it's pseudo-accretion behaviour. It simply randomizes the mass of the points which in turn is used to randomize the forces (Mass * force) in the ICE Tree time step most likely buried in the Simulate Particles node.
I used a Property POP to add a float mass attribute and use the ubiquitous expression setup:

fit01(rand($ID+1.001), 0.2, 1)

where:
rand($ID+1.001) returns a value from 0-1 that contains a random value given the particle's unique ID and a seed offset value of 1.001 just because I feel like 1.001.

Then take this random mass and modify the velocities directly. That's the most common method to directly affect particle motion is to drive values directly in to v and generally not in to force.

It is the randomness of the masses that picks the winers and losers in the pseudo-acretion set-up where by the larger guys eventually end up winning and sucking in all the neighbouring particles. Again it isn't the nearest point look-up doing it. That's just getting a field of values to work upon. Can do this in a few different ways.

As I mentioned in one of my earlier posts, you need to create a subset of points that will become the overall attractors/winners. Using a random mass is one way of selecting such winers from the losers.

As for adding the swirling motion as the heavier mass particles start to accrete surrounding points, that's easy to do and not in the ICE tree attached.

Again Mr Dickson and everyone else are trying to help you get to that initial youtube video result so don't be so harsh on us.

—-

These days I would not use this method. It's quite old school and out of date in Houdini. Using volumes to get weighted averages of regions can be far more efficient and allows you to decouple the number of points from the result which is always a good thing. The ability to simulate ten thousand points or tens or hundreds of millions of points and get a similar result is what is required these days. You ain't gonna get that with random ID seeds driving things.

Attachments:
pops_in_dops_pc_self_attraction.hip (349.1 KB)

There's at least one school like the old school!
User Avatar
Member
330 posts
Joined: 7月 2007
Offline
hi Jeff ,

wd be great to have the file ( you attached to your first post here ) installed with houdini itself in future .

it is the best ive downloaded which describes while-s , if-s , and other nodes .

im sure it wd take you 1/1000th of time it took you to make that scene .

thanks for it , anyway .




.cheers
except the things that cannot be seen , nothing is like it seems .
User Avatar
スタッフ
2540 posts
Joined: 7月 2005
Offline
I'll turn that first file in to a help card for the While VOP.
There's at least one school like the old school!
User Avatar
Member
543 posts
Joined: 7月 2005
Offline
Excellent post as usual Jeff, detailed, accurate and with grace!

Much appreciated as always!
8)


–Mark
========================================================
You are no age between space
User Avatar
Member
268 posts
Joined: 7月 2005
Offline
..the vid looks like interact pop.

Attachments:
interactpop.hip (422.3 KB)

  • Quick Links