-1
\$\begingroup\$

I have developed an iso engine for a farm game. In general it works fine, but the problem is that it is not always accurate when pressing the tiles, so the tile I wanted to select is not the one picked. Anybody has some ideas how to improve this?

\$\endgroup\$
1
  • 2
    \$\begingroup\$ You should at least provide some code that shows what you're currently doing so that people can tell you how to improve on it. \$\endgroup\$ Commented Feb 14, 2012 at 16:50

2 Answers 2

1
\$\begingroup\$

You should use a transform matrix. Check out this tutorial: http://www.alcove-games.com/isometric_tile_picking.php

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Could you provide a few paragraphs on what a transform matrix is? Link-only answers are highly discouraged on the Stack Exchange network. \$\endgroup\$ Commented Dec 2, 2012 at 2:24
  • \$\begingroup\$ ok basically what we're trying to do is creating a transform matrix that will match the isometric world. So then, when looking up for coordinates of your isometric tiles, all you have to do is vector v = inv(transformMatrix) * vector u. Your game camera is in fact a transform matrix. It just is very basic (identity matrix scaled by some factor). The transform matrix for an iso world is a bit trickier (rotation by 45 degree, scaling, translation) but there is nothing that is really complicated. Hope this helps! \$\endgroup\$ Commented Dec 2, 2012 at 3:50
  • \$\begingroup\$ Oh, I have no interest in this post, I was reviewing. I meant for you to add that into your post--it helps prevent link rot. \$\endgroup\$ Commented Dec 2, 2012 at 9:53
0
\$\begingroup\$

In this answer the ratio between the projected diagonal of a square laying on the ground are 70:30. You can generalize with ease for the particular perspective you are using.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.