Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:11:36+00:00 2026-05-19T03:11:36+00:00

My tile engine is coming along. It can draw square, hexagonal and isometric staggered

  • 0

My tile engine is coming along. It can draw square, hexagonal and isometric staggered viewpoints. Where I’m struggling is with the isometric rotated (or diamond) viewpoint. Below is a picture of a 10×10 diamond map and the (simplified) code used to draw it. The tiles are 128×64.

http://garrypettet.com/images/forum_images/5%20col%20x%205%20rows.png

for row = 0 to rowLimit

  for column = 0 to columnLimit

    x = column * (TileWidth/2) + (row * (TileWidth/2)) + Origin.X
    y = (column * (TileHeight/2)) - (row * (TileHeight/2)) + Origin.Y

    // Draw the tile's image
    buffer.Graphics.DrawPicture(Tiles(column, row).Image, x, y)

  next column

next row

// Draw the buffer to the canvas
g.DrawPicture(buffer, 0, 0)

I know that this will draw the contents of the whole of Tiles() and not just those visible on screen but I’m trying to get the basics first.

What I can’t figure out is an easy way to convert x,y coordinates on the map to tile column,row coordinates. I tried to reverse:

x = column * (TileWidth/2) + (row * (TileWidth/2)) + Origin.X
y = (column * (TileHeight/2)) - (row * (TileHeight/2)) + Origin.Y

To work out column and row given x and y and came up with this:

column = ((x/2) - (Origin.X/2) + y + Origin.Y) / TileHeight
row = ((x/2) - (Origin.X/2) - y - Origin.Y) / TileHeight

But that doesn’t seem to work. Can anyone think of a better way to do this? Is there a better way to transform a grid of rectangles into a diamond and back again (given that I know very little about matrices….).

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:11:37+00:00Added an answer on May 19, 2026 at 3:11 am

    I am not sure I can follow the details of your problem, but if you are just looking to solve your formulas for x and y in terms of column and row, then

    column=(x + y - (Origin.X + Origin.Y))/TileWidth
    row = (x - y - (Origin.X - Origin.Y))/TileHeight
    

    The easiest way to get these expression is to first add the expressions for x and y and solve for column, then subtract them and solve for row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone recommend a good Java game engine for developing simple tile-based games? I'm
Yo everyone! I have been working on an Isometric Tile Game Engine in HTML5/Canvas
Where can I find a tile engine for HTML5 <canvas> , for writing 2D
If I tile squares, and the squares can be defined by their coordinates, how
I've been working on a tile based map engine for my game project in
I am planning to rewrite my Python Tile Engine in C#. It uses a
I'm having a problem with a simple 2d tile-based engine I'm working on. On
I have a problem: I need an algorithm for my tile engine. I have
I'm drawing a tile-based game. Some tiles can rotate, about their centre. It appears
I want to draw a tile-based overlay on top of a MKMapView, but there's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.