0
$\begingroup$

I have a plane object. I used Proportional editing to change the height of the vertices on some places on the z axis, creating these 'hills'.

My goal is to have cubes instanced on these points, creating a voxel-like look. The plane is exactly as wide as 100 cubes. And it has been subdivided so that the location of the cubes on the x and y axis is already correct.

But I am struggling with figuring out how I can have the z location of these instanced cubes snap. So that there are clear horizontal layers of cubes instead of smooth like they are now.

I've tried using vector math set to 'snap' to translate the instances. But that didnt work well.

Is there a simple solution to this? Any help would be greatly appreciated :)

enter image description here

enter image description here

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

Here I have created a setup in which I set the position of the vertices of the ground plane mesh to have a step like look to. And on this mesh The cubes are now instanced.

The node tree: enter image description here

The final result: enter image description here

I seperated the z component of the position and used the snap operation. Then I recombined this back into the position and used the Set Position node to make the change in the ground plane mesh. Now on this mesh I instanced the cubes. (Make sure that that the value of the snap increment is more than the height of the cubes that you are instancing.)

$\endgroup$
1
  • $\begingroup$ Thank you so much! This is exactly what I was looking for. Tried doing something like that myself but couldn't figure out the right nodes to use :) $\endgroup$
    – Ward D
    Commented Jul 20, 2023 at 18:01

You must log in to answer this question.

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