For Each Problem

   1467   3   0
User Avatar
Member
45 posts
Joined: March 2017
Online
So I have hit a road block with a For Each Loop, as I always do and was wondering if I could get some help here.

I am generating unique rock shapes based on a Boolean and the seed of a Scatter node. It works great when I adjust the seed value, I get a new piece of geometry but now I want to scatter those rock shapes onto a new Scatter node based on a random seed in the first Scatter. Right now I can only scatter one shape, I would like to scatter different shapes based on the seed value of the first Scatter creating bigger “asteroid” shapes but I am stuck on the For Each part.

Attachments:
not_this.jpg (90.6 KB)
achieve_this.jpg (90.5 KB)
random_rocks.hiplc (132.3 KB)

User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Something off the cuff…you could do lots of changes/refinements to this.

Attachments:
random_rocks-2.hiplc (231.6 KB)

User Avatar
Member
45 posts
Joined: March 2017
Online
Thanks BabaJ for taking a go at it but maybe I wasn't clear enough. I am looking for a different result. Your file looks like one rock type scattered around, Im looking for more rock type variation based on the boolean with the seed adjusted.

I basically want to do the effect you achieved but with different rock shapes copied around. See attached image. Every time I adjust the seed in the scatter I get a new boolean rock shape or “cut” and I want to be able to scatter a unique rock shape on every point.

Attachments:
seed_rocks.jpg (51.9 KB)

User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Nope, they are different rocks used in each of the second loop.

If you go to the very last foreach loop end node and toggle Single Pass, you can see that for each iteration there is a new shape being used.

I've cleaned up my previous example a bit. For one I did a better reference piece for centers as bounding box centers can actually give a point outside the geometry; This was causing some leftover dangling pieces.

I also wrapped everything up as an embedded asset, so there's less hunting down the ‘essential’ parameters to output variations.

Even still if you don't like the variation of the pieces being used ( still seems too similar ) you can add a few very different initial input pieces and set up random inputting for the initial first loop.

Or you could even do small number of iterations with the ‘Rock Chain’ asset to get a simple varied shape, do that with a few, and feed them into a final Rock Chain asset, with that one set for higher final iterations.

Of course this whole exercise was about how to combine loop blocks to get this effect.

And if you take some time looking at the set up, it may give you some ideas to change it up a bit.

But if some final rock combination effect is the actual end desired, you might want to take a look at doing something with a sop solver and using frame iterations to build your formations. If that is so, maybe someone might show you a simple growth approach.

I also remember seeing a tutorial within the last two months or so in the tut section which shows crystal growth. I think that could possibly be slightly modified for more rock looking.(although I haven't watched the tut itself).
Edited by BabaJ - May 11, 2019 12:42:48

Attachments:
random_rocks-3.hiplc (218.5 KB)

  • Quick Links