Node XYZ Coordinates to whole number values?

Is there any way to turn an X/Y/Z coordinate node output and turn it into a whole value input? (0, 0.1, 0.2, 1, 2, 3, etc)

My goal is to be able to pick which color from a colorramp node by using the Z coordinate of an empty.

1 Like

Use the Vector Math node with the operation Ceil or Floor (depending you want to round up or down)…
This is if I understood your question correctly, because the your mentioning of the colorramp is a bit confusing (for which would be just to separateXYZ and feed the Z component into the colorramp).

I’ve been trying to use the Object output from a Texture Coordinate node and using an Empty as the Object, and then plugging it into a Separate XYZ node and plugging the Z component to the factor but what I get is this gradient and not 1 specific colour from the Color Ramp node.

What I am trying to say is that I am trying to get a specific colour from the colour ramp by the Colour Ramp node for example if the Empty is at Z=0 then the colour of the texture would be red (assuming the colour ramp colours are the same in the picture shown) and if the Z coordinate of the empty is 1, then the colour would be blue. Not a gradient.

I am sorry I am very very new to the Blender community I still have very much to learn so thanks if you could help :smiley:

1 Like

For that, you need to subtract the Z coordinate of your Emtpy to the Z coordinate of your Object.