mouse position to isometric tile including height
Struggeling translating the position of the mouse to the location of the tiles in my grid. When it's all flat, the math looks like this: this.position.x = Math.floor(((pos.y - 240) / 24) + ((pos.x - 320) / 48)); this.position.y = Math.floor(((pos.y - 240) / 24) - ((pos.x - 320) / 48)); where pos.x and pos.y are the position of the mouse, 240 and 320 are the offset, 24 and 48 the size of the tile. Position then contains the grid coordinate of the tile I'm hovering over. This works reasonably well on a flat surface. Now I'm adding height, which the math does not take into account. This grid is a