3
$\begingroup$

I have created a Geometry Nodes setup with a Repeat Zone to duplicate instances randomly along the X-axis and stack multiple rows on top of each other. A fixed stacking value is given so that each row has the same Z value. (see if needed Randomizing Stacked Rows of Cubes in Geometry Nodes with Fixed Start and End Constraints for my first issue about this setup that has been solved)

Now, I want to give each row a random Z value so they have different Z scales but still stack on top of each other. This should be like using an Accumulate Field node, but it does not work in the Repeat Zone loop. I can give a random Z value to each row, but I can't set the position of each row to stack according to this random value because each instance is moved individually.

First image shows a constant Z offset, second one shows a random Z offset but on each instance, last one is the Repeat Zone

Also, I need to keep the instances, so using a Realize Instances node is not possible.

In my Repeat zone, the output of the "NodeGroup" is the random Z value for all instances in a row. I want to use this by connecting it to the Set Position node to set the position of the entire row, not each instance separately.

Has anyone had a similar problem?

enter image description here

enter image description here

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

I managed to solve my problem.

Instead of placing each row individually, I create a point for each new iteration and place it at the desired Z value (by adding all previous Z values). Then, I instance my row on this point, so it gets placed at the correct Z position as a single object, avoiding the need to handle each cube individually.

I use a Realize Instances node to get the Bounding Box coordinates, but this node is not connected to the output, so the instances are not realized for my final object.

enter image description here

$\endgroup$

You must log in to answer this question.

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