2
$\begingroup$

For practice with geometry nodes, it seemed like a fun idea to generate a Jenga tower using nodes.

I managed to stack a bunch of generated blocks, but now I'm stuck..Ideally, I want to just set a count to like '5', where it will generate 3 blocks next to each other and then add a layer/z-coordinate to continue.

I tried using the 'greater than' node to test it out (a modulus %3 might also work) but I don't know how to add the next layers with keeping the first blocks in their place.

And as a further complication, I'd like the blocks to use physics. I created a base block for this that I can use as a node instance, but if I use this block as a node instance (instead of generating new cubes) the physics are missing.

Any help appreciated!

enter image description here

Update: getting closer with suggested setup:

enter image description here

$\endgroup$
1
  • $\begingroup$ Oli your setup looks fine at a first glance, but here's mine maybe you can find the issue... $\endgroup$
    – alambre
    Commented Mar 17, 2022 at 13:11

2 Answers 2

5
$\begingroup$

for the tower you could use the instances on a line idea to make first level, then repeat the concept with a second line -now vertical- and use your previous 'group' as the instance... use the 'level' index to rotate 90 degrees -a bit like using modulo- and you're done... place a 'realize instances' node at the end to be able convert to mesh

with the physics part I can't help you much, I think it's a 'destructive' process at the moment... will need to convert to mesh, separate by loose parts, set origin to mesh and add all to rigid bodies simulation... be sure to use 'box' as collision, you can copy it from active to selected

here's my node setup, you may find other ways...

node setup

ok, here's an other way, maybe it's more what you wanted..? based on modulo and snap functions, a bit more complex but all instances are 'single blocks' so you can go and delete them easily

node setup

here's the second blend file

have a little update here because it was part of you question... about rigid bodies, what I tried is using 'duplifaces' to generate real blocks from geonodes, I mean individual objects that can have modifiers... it's a bit easier to play with simulation now, press ctrl+A and it generates all the blocks

be sure to delete the '_TOWER' and the original 'BLOCK' object and then just play simulation... and see that the tower is now made of single 'faces' where we duplicated blocks... test the blend here

screen capture

it can also be done manually or with a script, this is the closest I could get with just GN

$\endgroup$
9
  • $\begingroup$ I added your suggestion to my question, it's getting close but the rotation isn't working as it should..could this be an origin point issue? $\endgroup$
    – Oli
    Commented Mar 17, 2022 at 10:35
  • $\begingroup$ Turns out it works when I align my block to the center of the grid! $\endgroup$
    – Oli
    Commented Mar 17, 2022 at 18:25
  • $\begingroup$ changed the first example to be able to delete some blocks by using mesh islands, as in this setup instances are in groups of 3 it was not that easy... that simple trick may be used to colorize blocks too -I saw you had a thread on that- $\endgroup$
    – alambre
    Commented Mar 18, 2022 at 14:33
  • $\begingroup$ Cool, thanks for the update! Fortunately I solved the color problem using another thread from here somewhere :) $\endgroup$
    – Oli
    Commented Mar 18, 2022 at 15:00
  • 1
    $\begingroup$ jaja no, the readme says Ctrl+A > Make Instances Real, that's the last item in the menu when you press Ctrl+A... or type F3 and search for 'Make Instances Real' $\endgroup$
    – alambre
    Commented Mar 19, 2022 at 21:50
2
$\begingroup$

One thing that's a little bit more advanced you can do is to use the Accumulate Field node along with a generalized bounding box size math to determine the placement of the vertices of your two mesh lines so they dynamically change according to the size and shape of your blocks:

I'm also moving the first layer of blocks back on the Y-axis to make sure they're always centered so the rotations on the vertical don't mess up. Here's the full node setup:

enter image description here

$\endgroup$
3
  • $\begingroup$ nice solution again @Kuboå $\endgroup$
    – alambre
    Commented Mar 17, 2022 at 14:24
  • $\begingroup$ @alambre Likewise! I like that yours enable deleting individual blocks, I realized that might be desirable too late so I didn't bother. Maybe OP could join both ideas together or something. $\endgroup$
    – Kuboå
    Commented Mar 17, 2022 at 14:30
  • $\begingroup$ This is a bit over my head for now, but I'll study it, thanks! I might reuse the 'center blocks on world origin' part, as that was the last issue I had..The Accumulate field was just added in 3.1 I see..good stuff $\endgroup$
    – Oli
    Commented Mar 17, 2022 at 18:27

You must log in to answer this question.

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