2
$\begingroup$

So, I want to create something like this but I want to randomize the aspect ratio of the little planes.

Most the answers I find are using older Geometry Nodes configurations with deprecated nodes. Can anyone help? Thanks!

cube volume with random planes

$\endgroup$

4 Answers 4

1
$\begingroup$

you could use this node setup:

enter image description here

$\endgroup$
1
$\begingroup$

Raycast

Here is one approach. The default cube will be the container object. Everything outside of the raycast area, we want to trim.

In the GN editor, the Mesh Line node is instanced on a Grid Node. On the points of the mesh line we also instance smaller grid nodes.

enter image description here

In order to give the instances of the planes random values we can use scale, rotate, and translate instances nodes. These can be plugged directly into random value nodes.

enter image description here

We can use a raycast node with the target of our default cube. The hit area output is connected to a math node set to less than. This goes to the selection input of the delete geometry nodes.

enter image description here

In the delete geometry nodes, If we set these to "only faces" we can see what is being deleted outside our default cube: enter image description here

When adjusted everything satisfactorily, we can turn it back to "all".

enter image description here

$\endgroup$
1
$\begingroup$

Here's a group that, given a cuboid, can randomly distribute planes in its volume, randomly scale the planes to specified limits, and clips the collection of planes to the cuboid.

In steps.. 1. Distribute instances in the given box:

enter image description here

The 'Count' input sets the number of planes. Since we can limit their depth, later, the planes may as well be cubes.

  1. Randomly scale instances to within specified limits:

enter image description here

  1. Realize the instances, clip them to the dimensions of the box:

enter image description here

  1. Just for illustration, here, this example stores the instance ID on each vertex of the realized instances. This uses the Mesh Islands node available in Blender 3.1a. It can be done in 3.0 by using the hack in this answer, but that's a bit of a faff... This group..

enter image description here

.. normalizes the instance ID's to floats between 0 and 1, and stashes them on the vertices of the realized instances..

enter image description here

... so they can be passed out of the modifier, and used by a shader:

enter image description here

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Thanks for explaining this method. $\endgroup$ Jan 4, 2022 at 22:32
0
$\begingroup$

enter image description here

Here is one idea. I have just connected the group input so that it can control the distribution in the modifier tab.

$\endgroup$
1
  • $\begingroup$ That's not a volume and the planes don't have random widths/heights $\endgroup$ Jan 2, 2022 at 3:27

You must log in to answer this question.

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