# Tiled map seen from an angle

I have working code to display a tiled map. It's composed of a OrthogonalTiledMapRenderer and an OrthoGraphicCamera :

camera.setToOrtho(false, WORLD_WINDOW_SIZE.x,
WORLD_WINDOW_SIZE.y);

renderer = new OrthogonalTiledMapRenderer(tiledmap, 1 / TILE_WIDTH);

renderer.setView(camera);


So far so good. The map is rendered as seen from above:

My question is, how do I render it with the camera not facing right down to the floor?

Like this: [Thanks to all GIMP developers :) ]

Is it possible? I tried Camera.rotate(45) but it rotates in the wrong axis. I can't set Camera.direction because of this - taken from OrthogonalTiledMapRenderer.setView(camera) documentation :

Sets the projection matrix and viewbounds from the given camera. If
the camera changes, you have to call this method again. The viewbounds are taken from the camera's position and viewport size as well as the scale. This method will only work if the camera's direction vector is (0,0,-1) and its up vector is (0, 1, 0), which are the defaults.

If I change the camera direction, the renders are weird or non-existant.

Is it possible to do so with the standard LibGDX api? If not, how can I do this? If not are there any workarounds to get the same effect?

• You can't do this with an orthogonal camera (orthogonal means 2D/straight down), what you should do is render what gets displayed on the camera to a texture that is placed on a plane in 3D and use a regular camera to display to the user. Then to get the rotation you want you can either rotate the plane or have the camera orbit around it. – Benjamin Danger Johnson Mar 14 '13 at 16:06
• Well, see the answer below: Now I know you can – UberLambda Mar 14 '13 at 16:11
• I believe that only works for rotating around the y-axis. I'm not sure if there is something that works on the z or x axis's. – Benjamin Danger Johnson Mar 14 '13 at 16:15
• Well actually that's true. But I can rotate the camera – UberLambda Mar 14 '13 at 16:17
• Ah, I think I see my confusion, I thought you wanted the camera to go up and down like you were looking at a table top game (which is pretty cool in my opinion) but you wanted an isometric view like in the old Age of Empires and Starcraft games. Yeah, the below answer should be good enough in that case. – Benjamin Danger Johnson Mar 14 '13 at 16:19

I think you are looking for isometric view. You should use OtrhographicCamera as you are using now, but construct it using this constructor, passing diamondAngle
public OrthographicCamera(float viewportWidth, float viewportHeight, float diamondAngle)