Find the distance between two isometric tiles

Started by
5 comments, last by wildbunny 13 years ago
Assuming each of the tiles fit in an area of 2200x1100 but are fit together according to the image. How could I find the x and y distance between two points on different tiles.
For example say I had a point (1550,550) on tile (2,2) and I wan't to find the x and y distance from that to (1550,550) on tile (2,1).

distancebetweentwoplanes-1.png
Advertisement
With the size of a tile as 2200x1100, you might make the observation that the upper left corner of this rectangle around a tile at (x, y), is the exact center of the tile at position (x-1, y).
So, simply put, because of the shape of your tiles, the distance between the centers of two adjacent tiles, is exactly half of the size of the rectangle around your tile.
This should help you to convert between your two coordinates.

With the size of a tile as 2200x1100, you might make the observation that the upper left corner of this rectangle around a tile at (x, y), is the exact center of the tile at position (x-1, y).
So, simply put, because of the shape of your tiles, the distance between the centers of two adjacent tiles, is exactly half of the size of the rectangle around your tile.
This should help you to convert between your two coordinates.


Ahh and the distance between say tile 2,2 and 3,1 midpoints would be a full width of a square? That makes it easy enough! Thank you!

(x1 - halfwidth) + ( x2 - halfwidth)
Edit: So say I was trying to find the xdistance between the two points in the example: (1550 - 1100) + (1550 - 1100)
no that isnt right... guess I still don't understand how you would get it even knowing the distance between two midpoints in a tile
Could you explain the equation for this a bit more?
Have a look here:

http://www.wildbunny.co.uk/blog/2011/03/27/isometric-coordinate-systems-the-modern-way/

Ignore the sub-optimal rendering order I describe at the beginning of the article :)

Have a look here:

http://www.wildbunny...the-modern-way/

Ignore the sub-optimal rendering order I describe at the beginning of the article :)


Thanks but I didn't see anything that helped there.

[quote name='wildbunny' timestamp='1303075803' post='4799618']
Have a look here:

http://www.wildbunny...the-modern-way/

Ignore the sub-optimal rendering order I describe at the beginning of the article :)


Thanks but I didn't see anything that helped there.
[/quote]

The main point of that article is that there are two basis vectors which define the isometric grid. These are what allow you to transform from screen-space into grid space to find the coordinate you are after...

Cheers, Paul.

This topic is closed to new replies.

Advertisement