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!
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!
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.
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.
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.
In the delete geometry nodes, If we set these to "only faces" we can see what is being deleted outside our default cube:

When adjusted everything satisfactorily, we can turn it back to "all".
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:
The 'Count' input sets the number of planes. Since we can limit their depth, later, the planes may as well be cubes.
.. normalizes the instance ID's to floats between 0 and 1, and stashes them on the vertices of the realized instances..
... so they can be passed out of the modifier, and used by a shader:
Here is one idea. I have just connected the group input so that it can control the distribution in the modifier tab.