Map Orientation

Started by
1 comment, last by Mayrel 22 years, 5 months ago
Simple question, I hope. What way ''round are iso maps usually placed?

# # #
 # # #
# # #
 
Method one. (0,0) is at the top-left, (3,3) at the bottom-right.

    # - (0,0)
   # #
  # # # - (3, 0)
   # #
    # - (3, 3)
 
Method two. Method two seems to be the most sensible, but I''m having trouble with it: my map renderer iterates through Y and X and will render the map in the method one style. How do I convert (0,0) in method-one coordinates to the correct coordinate in method-two, which would be (-2, 3), I believe. I''m wanting to do something like:
  
  for (y = 0; y < m_height; ++y)
    for (x = 0; x < m_width; ++x) {
      Transform(x, y, &tx, &ty);
      if (tile = GetTile(tx, ty))
        tile->render(x, y);
    }
  
It looks as though that the articles on coordinate conversions deal with converting screen coordinates to method-one coordinates, whilst I want to convert from method-one to method-two. Unless I''m reading the articles wrong, I don''t think they are of help. I demand unsatisfaction!
CoV
Advertisement
http://www.isohex.net/default.asp?GroupID=5&CategoryID=9&ItemID=31&View=Item

go to the above URL, and download the IsoHexCore engine. the class you want to look at is CTilePlotter.

Get off my lawn!

*reads source*

So, it is that simple. Great.

''Nuff said. I''ll enjoy watching you live, demon.
CoV

This topic is closed to new replies.

Advertisement