views:

286

answers:

4

I have a series of equirectangular images. I'd like to display them in a custom Flash player so that the user could see the spherical nature of the images, and "look up", "look down", "look left/right" (or pan, zoom, etc). (Note that I have a long series of images, so the library must allow for dynamic loading of the images themselves, rather than having the images "baked" into the SWF player.)

What is the best library to manage the display of the equirectangular images in Flash? By "best", I mean the most mature, most reliable, most robust, and fastest performing.

For reference, an example of an equirectangular image can be found at http://archive.bigben.id.au/tutorials/360/background/projections.html.

A: 

Although this creates a 3d impression, the problem has actually nothing to do with 3d, as long as you don't plan distorting the individual tiles to enhance the 3d effect.

All you need is a tile renderer, that supports scrolling, zooming and lazy loading.

There are several flash game engines that have tile renderers, but I think, that's not a good starting point. AFAIK, they do not use lazy loading (but all-in-one preloading) and do not have zoom. Yet, a look at their code might give you some inspiration.

Maybe you're luckier if you try to find an open source flash map viewer. It basically has all the functionality you need.

back2dos
On that note it might be worth looking into something like http://openzoom.org/ or http://www.zoomify.com/
heavilyinvolved
I think the presumption is that he wants to view the images as 3D panoramas, not just zoom around on a flat equirectangular image.
fenomas
A: 

I believe it can be done with Papervision3D, which is "mature, reliable, robust and fastest performing".

Lars
see my answer to fenomenas' post. also "fastest performing" is really just wrong. Papervision is the slowest of all 3D engines out there.
back2dos
see his answer to your answer ;)
Lars
Yes, please do. :P
fenomas
+1  A: 

When I did something like this a while ago I used Papervision3D, and had it up and running in maybe a half hour. Start with a simple example like this - that example doesn't use an equirectangular image, but by default PV3D treats textures on spheres as if they're equirectangular, so if you substitute in your image it should "just work". You'll just have to tweak the positioning so the camera is inside the sphere, and make sure the sphere is double-sided.

Best of all, it's easy to tweak the number of polygons to trade off quality for speed - you can do this live if necessary. (That is, after a few seconds if the framerate is too low you could nuke the sphere and make a new one with fewer divisions.)

fenomas
Papervision is neither very mature, nor does it perform well. This is just an extremely lazy way to tackle the problem. You don't need or want to use a full 3D engine in this case, because that's just throwing resources out the window. You can simply calculate ahead, which planes are visible and then bother distorting them. You can also simply render individual planes as loaders and use flash native 3d transformation. You don't need any z-sorting or culling for this problem.
back2dos
also, OP asked about lazy loading of multiple big images. For that to work at all, you need quite a hack. you have to create a new material type for that. simply hacking around in `BitmapMaterial` won't work, because the sum of all tiles may well exceed the maximum for `BitmapData`
back2dos
You're not grasping the problem, back. Flash's native distortion is for projecting a flat texture onto a flat 3D surface. With quirectangular textures, the texture's UV space is in spherical coordinates, and you're wrapping it onto a sphere. PaperVision3D does that out of the box, it does it fast, and you can load the images dynamically.
fenomas
A: 

It sounds like it should be possible to write a Pixel Bender kernel that handles the projection. The only problem there is that your material is split up into multiple tiles, so some other tool would need to load the sources first and precompose the required tiles for a certain view into one bitmap which then gets passed to the shader.

I searched on google and here is what I found: http://www.subblue.com/blog/2010/6/17/little_planets

Quasimondo