# Solved: Coordinates from a black / white ramp to a grid

Hi there,

i was successful to create a grid with x y z coordinates from a noise SOP.

Now i´m trying to do the same but with a ramp as an input but i somehow get stuck how i should convert black as a 0 position and white as a 1 position and link it to the grid i used with the noise SOP before.

Any thoughts or help here? I have attached my current TOX.

Thanks,
Jacob

GridwithRamp.tox (2.2 KB)

Hi @jacobb!

generally speaking - you would want to fetch color values from the ramp texture at positions of your grid points. To help with that the TopTo CHOP has an input that takes uv coordinates. These you can retrieve from your Grid SOP by converting the SOP to a CHOP using the SopTo CHOP. Now uv coordinates describe the space of your texture as always between 0 and 1 - meaning no matter what resolution or aspect ratio your TOP, the bottom left corner will have a uv coordinate of (0,0) and the top right corner will have a uv coordinate of (1,1). Hence - you will want to scale the grid to fit these dimensions.
Having done all this, the TopTo CHOP now returns color values for each grid point and you can apply these to the grid positions using the Chop To SOP.

TopToSOP.tox (2.3 KB)

cheers
Markus

Hey @snaut,

this is great, thanks! I found Pattern and Waves in the meantime and you can do nice things as well

But i want to go further with ramps and for that i have another questions rgd your example:

The grid in the final ChopToSop looks like it only gets / reads integer values, since it always goes from 0 to 1 without any middle steps as in float or as it should read from the grey values from the ramp. Any idea how to fix this?

When i attach the Noise CHOP the values are float again, so it seems to be a problem from the other chain.

All Best,
Jacob

Hi @jacobb,

it is actually working correctly, just looks like it’s only going from 0 to 1. If you change the Ramp TOP, for example set the `Extend Left` parameter to `Mirror` and/or increase the values by adding a Math CHOP after the TopTo CHOP, you can see that it’s properly offsetting the points.

Cheers
Markus

HI @snaut,

i see, great, thanks for you quick reply and help!

All Best,
Jacob