- The Blend
- Posts
- Slice
Slice
Set objects against the ground with Geometry Nodes
We have 2 new subscribers—welcome!
In The Blend, we break down 1 Blender technique each week in a micro-lesson. You also get bits of news and stuff.
The Blend aims to become the world's #1 Blender newsletter—thanks for joining!
Skip to the end for: a new low poly rock tutorial!
Blender 3.4
Can't make a mesh that sits perfectly on the ground?
This has been bothering me for a while—and I found an incredibly easy solution.
The first problem was simply flattening the object.
Simple enough: I stared with a Set Position node, and plugged a Position node into the Position input.
Which does nothing (that's the point.) It's simply setting the position of every vertex to the position of every vertex.
But now we can make some changes.
Add both a Separate XYZ and Combine XYZ node between the Position and the Set Position. Connect the Separate XYZ to the Combine XYZ. X to X, Y to Y, but...don't connect the Zs together.
And our mesh is flat!
But I only want the bottom of the mesh to be flattened.
Add a Compare node, set it to Less Than, and connect the Z from the Separate XYZ node. Now plug the Less Than node into the Selection input of the Set Position.
That does it! Now we're only setting the position of points with a Z less than 0.
This works. You can stop here if you like.
But what if the ground isn't flat?
Turns out that's pretty easy to implement. We simply need to use the Z position of the nearest point on the ground instead of Z position 0.
To get that Z position you can drag in your ground object from the Outliner and use a Sample Nearest Surface node set to Vector.
I tried this: I connected everything up perfectly, but it didn't work exactly as planned. In the end I had to use the position from a Geometry Proximity node to get the positions, but I still used the position from the Sample Nearest Surface node for determining the selection.
A picture's probably best:
Blender 3.4
That's it. It does everything we wanted: any part of your object that's below the ground mesh is automatically snapped to it.
If it's making some nasty geometry you could add a Merge By Distance node and figure out how to make it only affect the bottom vertices...but I didn't think it mattered much.
I don't really know why I wanted this, but it's nice to have. Maybe you have a great use for it.
Tutorials
This one shows you how to make a low poly rock generator with Geometry Nodes (there's some cool tricks in there.) In the end of the video I use this same technique to flatten the bottoms of the rocks.
News
It's 2023. Happy New Year.
The Fine Print
Know a Blender fan?
They'll probably think you're awesome if you forward them this email.
If someone forwarded this to you, do you trust them to do it again? Sign up for yourself here.
P. S. Have a topic you want covered? I'm always open to new ideas—reply to this email with your suggestions!
Reply