Sunday, 19 May 2013

How to get the visible Coordinates (Visible tiles)

How to get the visible Coordinates (Visible tiles)

I have Plane made of tiles in opengl. I start drawing them at (0, 0, -20) after that i do my translations so that the view is rotated somewhat similar to an isometric (kind of) perspective.
I'd now like to know, how many tiles are visible in each direction. So what i need to know basicly is, which coordinates (int the "before translation" - space) are now visible in the translated view.
The "tiles" before the translations" (for example in x direction there are 14 tiles visible):

And after the translations ( now there are 28 tiles visible in "old" x direction):

I tried to get the visible area via gluUnproject with no success.

No comments:

Post a Comment