iphone - Calculating the cells contained inside a rectangle on an Isometric Grid -
consider given isometric grid (consider diablo) of tiles. have measures grid, grid height, grid width , tile height/width. (consider image: http://2.bp.blogspot.com/_bazwykf2fdm/si2gbwd7kji/aaaaaaaabvw/bcb-eamgez4/s1600-h/isometric_grid). center cell of grid 0,0 extending iso-north (+y), iso-south(-y), iso-east(+x), iso-west(-x).
let's draw rectangle @ arbitrary location on grid. not have isometric positions rectangle, rather have normal draw coordinates grid top left hand corner 0,0 , south y+, right x+.
if had top, left, height, width of rectangle in question - how calculate array of iso-cells crossed bottom edge of rectangle.
any language choose demonstrate suffice.
in papers , books isometric programming (isometric programming direct x7, yes old gives overview problems , techniques) use mousemaps.
also there technique render area of map covered rectangle image, each tile gets unique color (and color rendered). afterwards check colors in image , extract list of tiles.
since using classic isometric tile width half height there mathematical solution too. unfortunatly suggested algorithm depend heavily on map layout.
Comments
Post a Comment