Skip to main content

How to handle very large images in Scene Graph

2 replies [Last post]
marlow_pete
Offline
Joined: 2008-04-10
Points: 0

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.

Regards,

Pete

Reply viewing options

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

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.

http://java.sun.com/javase/technologies/desktop/media/jai/
https://jaistuff.dev.java.net/
http://java.sun.com/j2se/1.4.2/docs/guide/imageio/spec/imageio_guideTOC....
http://java.sun.com/products/java-media/jai/forDevelopers/jaifaq.html
http://www.jguru.com/faq/view.jsp?EID=409513

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:
http://forums.java.net/jive/thread.jspa?threadID=38719&tstart=0

That is my 2c. ;)

liquid
Offline
Joined: 2005-06-16
Points: 0

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