Jump to content

For each POINT in each GROUP


LeSill

Recommended Posts

Hello guys

 

I am still quite new in VEX coding and I am all day fighting with set of gravitational rules based on a membership of the points in groups. I am emitting particles, the particles are sorted to groups by 3-6 nearest points. So after couple of frames of emitting particles I have 100 groups and each groups has 3-6 points.

Now I need to set some gravitational rules for every group so the points in every group will be attracted to each other just inside the group. I got stuck here.

 

If anyone has any idea how to solve this issue, it would be perfect. Many thanks in advance.

ap_ParticleGravitationalAttraction_01.hipnc

Link to comment
Share on other sites

your groups are not stable, it's difficult to see what you are trying to achieve

here is a file which assigns i@grp_id attribute to particles (currently based on i@id)

then modified Attract POP will make each particle attracted to the centroid of it's corresponding group, hopefulli it will give you some ideas

ap_ParticleGravitationalAttraction_01_mod.hipnc

Link to comment
Share on other sites

Could you please explain me why the groups are not stable? I was trying to figure out all day, why some points belongs to two groups forexample, or why the amount of points in the groups doesn't match the amount of points I have set up for the array based on the function nearpoints. I will attach a few pics.

The whole simulation should work like this (the PDF file):

1. points are emitted from a circle

2. when they reach some position they should be clustered to groups of fxp 4-7 points and then they should be attracted to each other inside the groups by gravitational forces (something like this http://www.entagma.com/custom-particle-system-in-vex/), they should create in the end bunch of sticked particles

3. after getting near to a "magnet", the sticked particles should be attracted to the nearest point/surface of the magnet and stick on it

 

I will be very grateful for any suggestions. Even though it didn't look complicated at the beginning, it does now beacause the lack of experience with vex coding.

Particle attraction.pdf

Spreadsheet_5a.jpg

Spreadsheet_4a.jpg

Spreadsheet_3a.jpg

Spreadsheet_2a.jpg

Spreadsheet_1a.jpg

Particle attraction.jpg

Link to comment
Share on other sites

Here is s new solution closer to desired result. The solution is based on Tomas' example of solution. I have just adjusted the sorting of the points at the beginning of the sim. The points get sorted right from the beginning. Now I will try to continue on the rest of the sim.

I am still curious about the POPNET + SOP_SOLVER solution where i could use the gravitational forces like guys from Entagma in this tut  http://www.entagma.com/custom-particle-system-in-vex/ . The problem I was facing are the mentioned problems above with sorting points to groups based on nearpoints function.

ParticleGravitationalAttraction_03.hipnc

Link to comment
Share on other sites

21 hours ago, LeSill said:

May I ask you if you from Slovak republic?

haha, yes, that's correct

5 hours ago, LeSill said:

I am still curious about the POPNET + SOP_SOLVER solution where i could use the gravitational forces like guys from Entagma in this

the issue is that using nearpoints from each point will not allow you to group those points to unique groups as each point will find different points within the radius, so you will not be able to tell which ones actually make the group

the way you drew it is like making arbitrary cell centers and then catching just near points to that, obviously it may be smarter, something like clustering using Cluster SOP, which tries to create groups/clusters of points based on spatial distribution so you can try that

you can also scatter random sample points within your box volume and group based on proximity to those points, therefore nearpoint() from each particle will find just the closest sample and take it's number (representing group or cluster), it will give you sort of voronoi distribution of cells

Link to comment
Share on other sites

Thank you for your suggestions. I have tried clustering, but there was a problem, that the amount of points changes each frame so the clusters are made again each frame with different points, position and so on. The sim is unstable then.

May I ask you for an explanation of the modification of the POP Attract node in the file you have sent me previously? You have unlocked this node and bound 2nd input to Myself. Could you explain me please what does it mean - how does it affect the function - what is the second input?

Btw I have checked the studio you are working in and the work looks amazing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...