Rendering isometric map with libgddx

I have a problem with IsometricTiledMapRenderer. Please correct me if i am wrong in something. With setView() method we choose a “region” where we render our content. So when i write me testProject like this it should be ok.

It works fine untill some moment when translating camera (long enough, especially in y-axis). it seems like the region of rendering is moving differently than camera. In the picture should renderer render the blue area, but it doesn’t (with distance “not rendered area” is getting bigger)

I can’t find any tutorial how to properly render isometric map. Map properties: 100x100 tiles and 80x28 one tile.
thank you for any help.

So the problem is that i am using isomteric map which doesn’t have tiles size 2:1 with angle between them 45° but 80x28 where the angle is lower. When i move the camera along the diagonal of my map like in the code (5f*0.35f) it’s moving well but in the IsometricTileMapRenderer constructor in init() method isometric transformation is realized with rotation of 45°. This cause that with code: renderer.setView(camera) renderer and camera moves differently.

How did i solve this?? :blush:

The transition works fine for example with this code:

mapRenderer.setView(_cam.combined,_cam.position.x,_cam.position.y/0.7f,camera.viewportWidth,camera.viewportHeight

Coefficient 0.7 is ration that fixs the differrent movement. Its calculated from 0,35/0,5 where 0.35 = 28/80 (size of my tiles) and 0,5 is form tiles with ration 2:1

I don’t know if there is other solution for this problem because i could’nt find anyone with this problem :smile:

Or you can somehow override init() method in IsometricTileMapRenderer and change rotation … but not sure about this.

So this is a bug (or missing feature) of libgdx, which ideally should be fixed in their code. Maybe you could open an issue about this on their tracker?

Thanks for sharing your findings!

1 Like