Hello I've read a few threads on this but i havent found anything with my specific issue. I want to try colouring my mesh based on specific Z values. So for example if its above 10 I want it to be red. At the moment I'm colouring it via the colour ramp method but as you can see in the attached image it only colours relatively. I dont know if theres a better way to edit the colour ramp to what I want? Because at the moment I dont understand why theres such a small segment of my mesh coloured orange. Or if theres a script I could use to colour it? Any help would be appreciated. Thank you
The Color Ramp operates in the 0-1 range.
To use a ramp to control color over the entire height of an object, no matter the size, use the Generated coordinate space.
If the actual Z height is important to what you're trying to do, you can use a Math node to divide the value coming out of Separate XYZ and bring them down to something the Color Ramp can operate on.
The same could be done with Map Range, it might be easier to control for values below 0 this way, or you could use a Mapping node to move up or down on the Z-axis.
The fact is that the Color Ramp takes values from 0 to 1, but your mesh goes from like -11 Z to 6 Z. The first color stop on the ramp is green, so anything below zero on the Z axis will be green.
I recommend using a Map Range node to fix this. Set the From Min and From Max to the lowest Z position and highest Z position on the mesh, respectively, and then leave the To Min and To Max at 0 and 1. Connect the geometry Z value to the Map Range input value, and send the mapped output value into the Color Ramp node.
In the meantime, you may want to use a Vector Transform node to convert Point Vector from World to Object. That way, no matter how the position or rotation of the land may change, the texture will stay stuck to it (the Geometry position input is in the World space starting off).