Advertisement

Screen to Space Coordinates - How difficult is it?

Started by June 22, 2001 08:23 AM
1 comment, last by Jiia 23 years, 7 months ago
Seriously, just ignore my post if I''m missing something here. I''ve been reading through the reference section, and found some articles about converting screen coordinates to isometric map space coordinates. I only read through about half of it to realize it was making it much more difficult than it had to be. My iso engine is 2D, so I may be missing something. But just in case, I wanted to share my method for converting coordinates. It seems extremely simple for you guys not to already know, so I''m hoping somone will explain why the article went so in depth and what they were trying to do. This is how I convert to map space coordinates: MapCoordX = (POS_X>>1) + POS_Y; MapCoordZ = POS_Y - (POS_X>>1); Z is in-out, not into-the-air-coordinates. And my tiles are 64x31 in size. The usual ratio. Like I said, this seems pretty simple for you guys to not already know, but maybe it helps someone. Shed some light on me if I''m wrong. Jiia
the method you are using will work for the specific case of a 2:1 tile ratio. the articles speak of more general purpose solutions, since not all iso maps have a 2:1 ratio.

Get off my lawn!

Advertisement
Also, Screen space to Map Sapce is a translation but Screen to Tile is trickier since a given map space coord can land in multipel overlapping tiles.

The "MouseMap" trick Tan shows in his book is an easy and efficient way to resolve that

This topic is closed to new replies.

Advertisement