solved:

it's actually not related the camera pos/angle, it's related to hit.x or hit.y being negative or positive.

tile.x = hit.x - (hit.x% grid_size) + (grid_size/2) * sign(hit.x);
tile.y = hit.y - (hit.y% grid_size) + (grid_size/2) * sign(hit.y);

Last edited by Quadraxas; 03/05/10 18:32.

3333333333