0
$\begingroup$

I am creating a simple gravity simulation between instances using the new simulation nodes. However, I am unsure how to, for each point, find the resultant vector between all other points. The images crudely represent the process for one of the points, which is then repeated for all other points.

individual direction vectors resultant vector

Currently I am repeating the gravity calculation nodes with each instance pair and adding those results. This works fine with only 3 instances, as shown in the blend file, but I feel there is a better way to do it. I have been trying to use accumulate field in some way but I can't seem to get it to add up the correct vectors. I can easily find the individual acceleration vector between any two points through their indices but I can't find them for all n number of points and add them together effectively. How would I got about finding the resultant vector?

Any help is appreciated, thanks.

$\endgroup$

1 Answer 1

4
$\begingroup$

You need a loops for that kid of operation, atm geo nodes doesn't have it but is possible to achieve loops using duplicate element workaround.

Node setup: enter image description here

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .