Hello,
We have implemented a 2D image viewer using JOGL to display large medical images. It allows the user to smoothly pan, zoom the image. Now we want to display the overview of this viewer which will display the entire image in a small viewport (preferably in the bottom right corner of the viewer) with a rectangle displaying area which is presently visible in the viewer.
Are there any existing options from JOGL/OpenGL to achieve this?
If not, can someone give us directions to implement the overview?
I assume that you'd like to show a kind of minimap like in some video games. Do you store each large image into several textures? It shouldn't be difficult to draw them in the bottom right corner.
Often I've seen people do this purely in 2D graphics -- they just draw a scaled-down version of the full image, then draw a box on top of it, using their windowing toolkit's 2D graphics calls :) This can be the best option if your overview image is outside the main 3D viewport of your app. But if you wanted to do this in JOGL, it would be straightforward. You'd just apply a scaled-down version of your full image to a quad as a texture, then draw 3D lines above it (i.e. between the quad and the camera). You're probably already doing something very similar to this to draw the pannable/zoomable version of the image.
Yes. At present I am doing the first option you suggested. That is, drawing the scaled down version of full image using SWT graphics on a composite (I take a snapshot of the GLCanvas and draw its scaled down version on the composite). But, I wanted to check if OpenGL has some easy way to achieve this. My image is tiled image, so the entire image consists of may textures arranged in grid. Drawing those all textures for the overview seems like lot of work.
Well, you could just render the overview in a second viewport with the camera much farther away and stationary, and put a square of 3D lines over that. If you have good mipmapping for all your textures this might get good performance. But I'm assuming your original image must be very large or you wouldn't have it tiled, so mipmapping all of these is probably not a good solution, since it'll just use up more texture memory :)