Trying to port a java2d demo app to a dekstop libgdx implementation.
This app plots data that is in inches. The plot is like a map in that it is an overhead view of a terrain. I use OrthographicCamera in libgdx and I am able to move left/right/up/down/zoom, all of that works great. I’m struggling with window resizes.
What I want to happen is that a window resize just allows the user to view more of the map at once. What I’m seeing is that the entire scene scales to fit the new window-size.
For example: If I have an object that is 50inches x 50inches in world coordinates AND at the current camera zoom level is 50pixels x 50 pixels on the screen, when the user then resizes the window, I want the object to stay 50pixes x 50pixels and more of the world to be revealed.
How is this accomplished in straight opengl terms?
How do I configure libgdx’s camera to facilitate this?
What is right term for the kind of scene I am trying to setup (my google foo has failed me here)?
In plain OpenGL you would do something like:
on each window resize or redraw. This makes sure that one OpenGL unit corresponds to one pixel and window resize’s don’t scale the scene.