4

In Tiled editor there is an isometric map example: "isometric_grass_and_water.tmx". This example shows simple isometric map with tiles which have size 64x32 pixels.

I need to know size of the side of a tile, so I simply used Pythagorean theorem for this: enter image description here

In right-angled triangle ABC side AC = width / 2 = 32 and side AB = height / 2 = 16. Thus side of a tile (BC) can be calculated as:

enter image description here

So whole tile is a rhombus in which each side = 35.777.

However when I add an square object with dimensions 35.77 x 35.77 to the Tiled, it not fits into the grid (it is actually bigger than on tile). But if I add object with dimensions 32 x 32 - it fits perfectly.

Please take a look on this image (object A is 32x32, and B is 35.77x35x77):

enter image description here

How is this possible? Is Tiled uses some kind of scaling, or something wrong with my calculations?

ovk
  • 2,318
  • 1
  • 23
  • 30
  • How is the size of "rectangle B" 35.77 x 35.77? It looks like a rectangle on screen -- its width should be greater than its height, but you say they are equal. – Jongware Jul 14 '14 at 23:05
  • It is a square in isometric projection (a rhombus) and size of its side is 35.77. – ovk Jul 14 '14 at 23:58
  • Measuring the difference between A and B alongside the edge, I get '106 pixels' for A and '119.85 pixels' for B. Those numbers don't mean anything to me, except that their ratio is *exactly* the same as between 32 and 35.77. ("Exactly", allowing for some rounding errors.) This suggests that you should draw B at its **intended** size: 32x32 pixels. – Jongware Jul 15 '14 at 15:12
  • It's because map is zoomed in (as you can see the in bottom right corner). Yes, I understand that it looks like I have to draw 32x32 object, but the question is - Why? Because math says to draw 35.77x35.77. – ovk Jul 15 '14 at 17:28
  • According to Wikipedia, "isometric" video games is not truly isometric, but rather a parallel projection. Perhaps that causes the difference you notice. – Jongware Jul 15 '14 at 17:38

1 Answers1

10

In isometric mode, the objects are projected into isometric perspective. Since Tiled normally uses pixels for object position and size in orthogonal mode, I chose to use a virtual pixel grid that is projected onto the isometric plane. This grid uses the tile height as the number of subdivisions of the tile grid, hence an object with its width and height equal to the tile height will fill exactly one tile.

My apologies that this has never been documented properly. I will get to the documentation once all the features are in!

Thorbjørn Lindeijer
  • 2,022
  • 1
  • 17
  • 22