Help to read the UV coord

I’ve some problems in the displace script :frowning:

I try to explain the rebus…

The script use only greyscale tga, not compressed. After
reading the image, I’ve the imagedata stored
in a list like

pixelColor = [255, 100,255, etc…]

where each value is the greyscale value of each pixel. This is simpler
of rgb image, where I must handle 3 value for each pixel.

The problem is recover the correct index in this list using the UV coordinates.

Actually I using this formula (for not zero based list):

sizeX*U + sizeX * (sizeY *V -1)

but it dont’ work correctly for all cases. I’m begin crazy
to try the correct formula. I’m trying to study the UVexportmap
script, but it’s very complex and rgb based…

sizeX and sizeY are the size of tga…

I’ve solved :smiley:

Yay, I wanted to help but I’m just a humble artist or maybe not so humble but I’m terrible at math and my python is very basic so was hoping some python guru would see your question and help you out. I am so wanting to try this script :stuck_out_tongue: So out of curiosity was it a solution with python or your formula?
Paradox (the patient and anxious at the same time)