2
$\begingroup$

I'm doing some mesh to voxel geo nodes and want to transform a given mesh into a blocky shape. Then I only want to colorize the top layer of the blocks. That's where the problem begins:

How can I get (index independent) a selection of points, which don't have another point right above them? A certain Z distance should be the deciding factor here (if possible).

Or is there a way to do it with texture coordinates, which look for the top most face and color the mesh from it's given Z coordinate and downwards?

I have been searching it for the past hour and been trying some things by myself, but no solution found so far.

Is this even possible?

Appreciate any help

image of a voxelized mesh

$\endgroup$

2 Answers 2

1
$\begingroup$

Rather than first spawning cubes, then coloring them, I'm first spawning triangles, then spawning colored cubes based on the topology.

The topology here means the logic between cubes, and more specifically, how much space is above any given cube - raycasting is used for that; here at least 4 empty cube-spaces are required for the grass to grow:

$\endgroup$
1
  • $\begingroup$ Now this is insanity. Absolutely love this solution. Thank you so much <3 $\endgroup$ Nov 19, 2022 at 11:35
3
$\begingroup$

you can try it with this node setup:

enter image description here

The "trick" is here to instance curve lines. And with endpoint selection you can identify the start and end points.

result:

enter image description here

video tutorial: https://youtu.be/ZleGuOP3Rpk

$\endgroup$

You must log in to answer this question.

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