🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

World coords to iso coords with square tiles

Started by
0 comments, last by Sphet 24 years, 5 months ago
So .. after some testing and timing I''ve decided on using large 192x192 square tiles for my ground plane and smaller tiles for my objects. An ''unit square'' in my coordinate system is 32 x 32 pixels, so that''s 64 x 32 pixels in iso coordinates. Therefore I store my current view or world coordinates and simply devide by 32 in each axis to get my map index location from the top left. I know I could do this all using 3d coordinates and not use a map[][] array but I have lots of data that needs to be stored in specific 32 x 32 point locations so its the best to do.. To speed things up I draw the ground as huge squares that have isometric drawings on them but arn''t diamond shapes. This works great and all, but I am having a hard time figuring out how to use my world coordinates to figure out which SQUARE tile I should be displaying. I need to be able to look into the appropriate index location and draw the square ground plane tile in the right place. Has anyone tried doing this or does anyone have any ideas?
Advertisement
why cant you just take the raw world pixel coordinates, and divide by 192 each way to figure out which one you''re on?

Get off my lawn!

This topic is closed to new replies.

Advertisement