Advertisement

Is point within Tile?

Started by July 16, 2000 06:05 PM
0 comments, last by cyberben 24 years, 5 months ago
Ok I think I can finally get this to work. I have a tile which is 68pixels wide by 33 pixels tall. A few weeks ago someone or some people had some formulas to check if a point was within isometric tiles. Someone showed a formula for a 48x48 tile and a formula for 32 x 32 tile. Can anyone create a formula for this tile: If not I''m fine with doing it with a ploygon test, but they said a formula would be MUCH quicker. (I appreciate speed. Especially in a games!) Thanks, Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
There is a very easy way to do this for any isometric tile without the use of formulas and complex mathematical types.

This is done with the use of a mouse map.A mouse map is a bitmap that looks like this:


You just have to determine on which color your mouse is pointing at.If it is white then you are ON the tile.If another color then you are on another tile.

For more information check TANSTAAFL''s tutorial:
Isometric ''n'' Hexagonal Maps Part I here in GameDev.

Voodoo4


Here these words vilifiers and pretenders, please let me die in solitude...

This topic is closed to new replies.

Advertisement