Skip to main content
2 of 6
edited tags
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Click on an isometric plane and obtain normal coordinates

I have photos distributed as cells. When I click, I get the corresponding row and column. console.log("Col:" + X + "Row:" + Y);

When applying an isometric view conversion like this:

ctx.translate(0, 300); ctx.scale(1, 0.5); ctx.rotate(-45 * Math.PI /180);

I do not know what mathematical formula applies to get the coordinates correctly.

Regards.