I made a 2D isometric renderer. It works fine but now I want to show my scene from 4 different points of view (NE NW SE SW) but, on a 90° rotation, my camera cannot keep the center of my scene on screen.
What's working :
- I calculate new projection of scene to match the new viewport (x y z in my world).
- I reorganise part of my scene(chunk) to draw them in a correct order
- I reorganise 'tiles' of 'chunks' to draw them in a correct order
- I can keep the correct center with a 180 degrees rotation.
What's do not working :
- I cannot find a correct translation to apply to my camera after a 90 degrees rotation.
What I know :
- To keep the same center on a 180° rotation with my camera I have to do this :
camera.Position -= new Vector2(2 * camera.Position.X + camera.Width, 2 * camera.Position.Y + camera.Height);
Illustation of the problem :