I'm attempting to calculate grid coordinates from mouse coordinates on a rectangular isometric grid (like below). The rendering is not in a diamond pattern but offset by a half tile on odd rows.
The origin point is at the top of the 0, 0
diamond.
My first attempt was trying to offset the diamond-grid rendering, which failed miserably. I've also tried an affine transformation approach, but that also seems to be for diamond-grid rendering and had the same problems.
Are there any formula for translating from a diamond grid to the type below, or other approaches to figure out which grid cell mouse coordinates intersect with?