Isometric Tile Map - Drawing
#1 Members - Reputation: 103
Posted 30 May 2012 - 06:58 AM
I have started lately working on my 2d game which uses isometric tiles in one of game aspects, however I run into small issue. The tiles are being draw as polygons with different colors there is no problem within it as long as the tile size is 1 unit x 1 unit, unfortunatelly I require tiles being different sizes and I stuck here.
Obviously the points for tile 1x1:
Top: x + w/2, y
Right: x + w, y+h/2
Bottom: x+w/2, y+ h
Left: x, y+h/2
The question is how do I apply different sizes to it? The tiles could be 2x3 ,3x2 (x/y)etc. Is there a simple to do it or I will have to test sizeX / sizeY and create the points different way?
Any help would be appreciated,
Many thanks
#2 Members - Reputation: 280
Posted 30 May 2012 - 10:32 AM
My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz
"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."
#3 Members - Reputation: 103
Posted 30 May 2012 - 03:05 PM
My map required a polygons with sizes 1x1,1x2,1x3,1x4,1x5,2x1,2x2 ....
I dont have an problem drawing all same sized tiles 1x1,2x2,3x3,4x4,5x5 (blue tiles), the problem comes along with red tiles. There need to be a simple way to calculate their points (right middle, bottom middle, left middle).
I have been looking around for some articles about it, other topics but couldnt find anything. The only way I can see would be checking if (sizeX==sizeY) or (sizeX > sizeY) or (sizeX < sizeY) and using different function for each of this types. The function would return a vector with points, however it will require 3 functions for 3 types and I would like to avoid it. There needs to be a different way doing it, I just can't figure it out,
#5 Members - Reputation: 1834
Posted 30 May 2012 - 04:41 PM
Edited by FLeBlanc, 30 May 2012 - 04:42 PM.
#6 Members - Reputation: 115
Posted 19 June 2012 - 10:43 AM
as you have written,i dont know what the point (x,y) does mean,and the also as the w and h.if w for width ,h for height,then the point(x,y) would not be the center point of the title.if in this case ,what about the point of the title( 2 X 3)?Top: x + w/2, y
Right: x + w, y+h/2
Bottom: x+w/2, y+ h
Left: x, y+h/2
So,i cant say something ,but if you just display it just as the image as you have provided,you can set the (x,y) as the left point and have a try.It will be easier or you can provide more details
#7 Members - Reputation: 375
Posted 20 June 2012 - 08:14 AM
An image or an explanation of the actual issue would be helpful.
Edited by Syranide, 20 June 2012 - 08:15 AM.
#8 Members - Reputation: 280
Posted 20 June 2012 - 08:57 AM
Top.X = x + WidthPerTile / 2
Top.Y = y
Left.X = x - RowsOfThisTile * WidthPerTile / 2
Left.Y = y + RowsOfThisTile * HeightPerTile / 2
Bottom.X = Left.X + ColsOfThisTile * WidthPerTile / 2
Bottom.Y = Left.Y + ColsOfThisTile * HeigthPerTile / 2
Right.X = Top.X + ColsOfThisTile * WidthPerTile / 2
Right.Y = Top.Y + ColsOfThisTile * HeightPerTile / 2
I'm not 100% sure this is correct, but I assume you are looking for something like this?







