index = x + (y * width)
Is it possible to do the opposite? Take an index and get the corresponding (x, y) coordinates?
Because if it is, I certainly haven't been able to figure it out.
index = x + (y * width)
You know how you can represent a 2D array with a 1D array by converting the coordinates to an index, right?
index = x + (y * width)
Is it possible to do the opposite? Take an index and get the corresponding (x, y) coordinates?
Because if it is, I certainly haven't been able to figure it out.