Hi there!
As stated in the topic i don’t get the whole trick about these two. My aim is to display a rectangular texture with an orthographic projection, which should then be handled like pictues in photoshop for example (e.g. panning, zooming in % and so on). This works particulary with this code:
gl.glViewport(0, 0, img_width, img_height);
float zoom_x = zoom_borders_x*(1.0f/zoom);
zoom_x/=2.0f;
float zoom_y = zoom_borders_y*(1.0f/zoom);
zoom_y/=2.0f;
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(-zoom_x, zoom_x,-zoom_y, zoom_y, .0f, 1000.0);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
where zoom_borders_* are initially set to img_height and img_width.
When zoom = 1.0 the displayed texture has exact the size of the image, great.
But now the whole area of the JFrame should be useable, which is not in this case, e.g. when I
pan the image to the right it disappears before the right end of the JFrame cause of the glViewport-setting,
same behaviour when I zoom in…
Anyone got an idea how i could use the whole JFrame without loosing the aspect-ratio and the right pixel-representation (one pixel of the image
= 1 pixel on the screen). I tried it with multiplying the values in glViewport, but this doesn’t seem to work correctly
thanks for reading, hope my problem is understandable and maybe solveable
greetings
basti