Skip to main content

How to handle very large images in Scene Graph

2 replies [Last post]
Joined: 2008-04-10

I'm developing an applet that uses a large image as a background to the scene. The designers also want the users to be able to pan left/right and zoom in/out of the image. Does anyone have examples of doing this kind of thing? If you have a single large image that is already loaded, moving it around and scaling it isn't too difficult, but what about a panning method that loads new image segments as they are about to come into view, or a zoom-in function that can load higher-resolution images as needed? Any suggestions, code samples, or other information would be very helpful.



Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-03-19

I believe you asking about "Tiling" and this is something JAI can do as long as the image is in the proper format. Otherwise, you would have to write your own tiler much like google maps does.

The key to having tiling work with JAI is that your image would first be converted to a Tiff format (this can also be done with JAI in a few lines of code.) and then JAI can take care of the rest. They even have examples of using a scroll widget. The internet equivalent would be to "hook" up an Observer to JAI and integrate it with Scenario. Nasa also uses it for really big images.

I believe with Zooming and changing resolution on the fly is in the realm of a Level-of-Detail algorithm. That is something I haven't seen anyone do other than google maps.
My guess is you would have several Tiff images and a level indicator that swapped images into and out of JAI and scenario.

I posted a simple approach to zooming on the group:

That is my 2c. ;)

Joined: 2005-06-16

I have one suggestion, look around for clipmaps. I don't know anything linking clipmaps and java though.

And actually another one, there's a mapping component in swingx (i believe it's in swingx-ws IIRC) which could also do the trick !

Message was edited by: liquid