1
$\begingroup$

I have two geometry node objects. One with ~300 and one with ~90.

I would like to take ~90 instances from the ~300 object and move them to the locations of the ~90 in the other object. But I can't see to find how to randomly grab a specific number.

$\endgroup$
5
  • $\begingroup$ Does this answer your question? Geonodes mix position with random index values - How to make random values unique? $\endgroup$ Jun 6, 2022 at 10:04
  • $\begingroup$ No. That shuffles all of the elements. I would like to just grab a specific number. $\endgroup$
    – TheJeran
    Jun 6, 2022 at 10:15
  • $\begingroup$ You're right, this is a different question than the one @MarkusvonBroady suggested, but basically it's actually the same problem we have here: The stupid random node can't generate unique values.... $\endgroup$
    – quellenform
    Jun 6, 2022 at 10:21
  • 1
    $\begingroup$ @TheJeran that's pretty much the same, just make a check Index -> Less Than and pass it to a selection or, multiply the boolean (which is 0/1) by the factor of the lerping in the MixRGB node. Saying it's not the same is like saying the poster there wants to move circles, but you want to move squares. $\endgroup$ Jun 6, 2022 at 10:40
  • $\begingroup$ What makes this problem potentially different is that with small enough fraction of the entire geometry (below 99% should easily do for my raycasting algorithm there), you shouldn't have to worry about duplicates. $\endgroup$ Jun 6, 2022 at 10:44

1 Answer 1

4
$\begingroup$

This looks to me to reduce exactly to a shuffle-problem, as discussed here. Whichever method you choose, having shuffled the indices, select all instances whose index is less than n, the number you want to move. Having separated the selection, it acquires a new, [0 -> n-1] set of indices:

enter image description here

... and can be aimed at the positions of the [0 -> n-1] index-bearing elements of your target:

enter image description here

$\endgroup$

You must log in to answer this question.

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