I have some stylized hills created with geometry nodes (by attribute sample texture) now I need to scatter some spheres only on horizontal parts of the hills. How can I do that?
You can use the Density input of the Point Distribute node to test against the local normal. If the normal's Z component is 1, the face is horizontal, facing straight up. If it's lower than 1, there is a slope. The closer it is to 0, the closer it is to vertical. It can also be negative but in the case of regular hills this should not happen.
In the end we have 2 inputs :
- Factor : At which angle the objects will start spawning
Possible improvements :
- Change the Factor input to be a maximal angle instead, using some simple trigonometry :
- Use a gradient falloff instead of 0 or 1 values when the criterion is met. Using the Attribute Map Range we can setup gradients.