PanoSalado: Many updates, being dogfooded, GoogleCode repository

Hi there:

PanoSalado (the open source Flash panorama player/viewer) has been through some major changes! Zephyr and Patrick have been pounding madly at the keyboard, putting PanoSalado through its paces.

PanoSalado is now being dogfooded... You can see a live, public example over at Patrick's site. The image quality and performance match or better the quality of any of the commercial Flash panorama viewers out there, so we think it's worth a look. Enjoy!

This example currently uses four .swf files to make it go. There is a container .swf which handles general setup and loading. The interface .swf displays the buttons and load progress of the panorama(s). Since people seem to like custom cursors Wink, we added in a Cursor.swf for good measure (thanks for the images hum@noid!). PanoSalado.swf is the core engine which handles display of the panorama itself. PanoSalado looks for an XML file to define the "tour" (one file, one tour!).

This should show you how modular PanoSalado can be -- you can design your tour in one or many documents, and never need to touch the core PanoSalado.as file at all. I should note that this Flash panorama viewer never touches Flash's stage quality settings in order to make panning more smooth -- this means that all your Flash elements will keep their aliasing as you like it.

This is an open source initiative, however humble. Smile Anyone interested in assisting with code, ideas or general evangelizing is more than welcome. Feel free to contact Patrick (me) or Zephyr via FlashPanos.com's contact form. At the very least, leave a comment below... We look forward to it!

There is a new GoogleCode repository for the FlashPanos.com PanoSalado project. Interested folks can download both source and examples from there, or use their favorite flavor of SVN access.

I'll cover some of the files and code in the latest rev of PanoSalado (momentarily), but wanted to note some things we're working on.

  • Yes, PanoSalado will import QTVR files! A major part of this will be respecting the QTVR pan, tilt, zoom values. So, no more guessing -- PanoSalado will import your QTVR and open it to the initial pan/tilt/FOV you expect. PanoSalado will import QTVR with any number of tiles (ie, 1x1, 2x2, 3x3, etc.). The PHP parser script is based on one of several versions of it floating around out there, and is already included in the source download of PanoSalado -- it just needs some minor tweaking, and it will be ready to go.
  • Yes, PanoSalado will handle Video Panoramas. Not that difficult to implement, but will require some tweaking; coming soon.
  • Yes, PanoSalado will handle video/audio hotspots. Not that difficult to implement, but will require some tweaking; coming soon. Smile
  • Documentation. This is the most difficult part of it all, no? Wink For the Actionscript, we'll be heading to ASDoc or something similar, which will let folks browse the classes/code/docs in their browser in a nicely formatted way. Coming soon.

Exciting! Cool

Cheers,

Patrick

ps: the basic XML structure for PanoSalado is discussed in the FlashPano forums. enjoy!

Once you've read that, check the follow-up forum post for part 1 of the complete XML discussion.

Very impressive, guys. The

Very impressive, guys. The independent quality from the stage could prove quite nice. Haven't a clue how you did that. I thought there was only one stage and only one quality for everything on it.

re: PanoSalado and impressive quality

Hey Scott:

Good to hear from you!

Yes, you're right -- the quality setting affects the entire stage. PanoSalado doesn't use quality at all when adjusting the in-motion or at-rest views of your panorama. It's using bitmap/precise materials.

Zephyr can go on about the BitmapMaterial rewrite he did, of that part of Papervision's core, and how it works -- but suffice it to say that we're using that rather than quality.

I'll post here with a walkthrough of the XML for PanoSalado; right now we're checking out how best to display all the documented/commented code -- and I hope we can use the same method for XML as we use for the Actionscript. It will make life a whole lot easier.

Cheers,

Patrick

Clever. Is "bitmap/precise

Clever. Is "bitmap/precise materials" a Papervision exclusive or a trick others, oh, say like FPP, could use?

re: bitmap/precise materials

Ha, I don't know... FPP is pretty closed to us. Currently it's a PanoSalado exclusive.

Smile

In re: to bitmaps and precise materials

Hi Scott,

As for FPP using precise / bitmap materials, I suppose it could, since it too is actionscript, but being closed source, I don't really know how complicated it would be to implement it. Maybe I will just explain what a precise material is in Papervision, and then you will see what I mean.

Perspective distortion (correction) in flash is accomplished by mathematically imagining objects in 3D space, which are built out of triangles (based on the principle that any arbitrary straight line enclose shape can be broken into triangles). And then to render the scene imagine painting a sphere made of small triangles onto a canvas, it will be a circle. The triangles on the edge of the sphere will be very narrow, since they are seen from a very obtuse angle, and the triangle in the center will be normally proportioned, since it is seen straight on. So those imaginary triangles are laid out on the bitmap and cut out of it as though it were cloth, and then stretched and squeezed into the two dimensional shape they need to assume. It is very much like projecting an image onto the film plane of a camera. The closer to straight on that the imaginary triangle is being viewed the less stretching the bitmap requires, and the more obtuse the angle the more stretching is required. Again, think of the triangle on the edge of the projected sphere which is being viewed side on and stretched so it appears to be like a straight line.

However, here we get to the problem--Flash 9 can not stretch a bitmap with perspective. In perspective parallel lines meet at a vanishing poing, and with Flash's distortion parallel lines stay parallel. So, the vertices of the triangles are in the right places for perspective, but the bitmap between them doesn't quite stretch right. (This is what cause the "wave" or "wiggle" in Flash panoramas.) Another way to understand the difference is to compare in Photoshop how an image moves within the bounding shape if you apply a perspective distortion versus a skew or "normal" distortion.

Thus in Flash the more and smaller the triangles, the better the approximation of correct perspective. It is like Calculus, which approximates a curve with ever increasing numbers of straight lines, the more straight lines, the nearer the approximation.

OK, so....

FPP and normal bitmapMaterials in Papervision use a fixed number of triangles, whether the viewing angle is steep, showing lots of wiggle, and needing more triangles, or whether it is straight on and needing almost no triangles for perfect perspective distortion. However, with precise materials, the incorrect distortion in pixels that a certain triangle would yield is measured, and the triangle is split into smaller sub-triangles, until the distortion is below the pixel precision threshold. So you can get really precise perspective distortion. In other words, you can get zero "wave" and "wiggle". And it is more efficient than it would be if you used that many triangles everywhere since it only splits up triangles when the distortion would be too high.

So, for this to be implemented in another viewer, the author would simply have to write an alternate rendering algorithm that measures the incorrect distortion and subdivides the segments until the distortion is at a tolerable level. I don't doubt that Denis Chumakov could do that in FPP. And I don't know how far the specific implementation of this triangle tessellation is from something that would easily accommodate precise rendering.

On a final note, the entire Flash 3D landscape should change significantly once Flash 10 is in wide distribution, since it supports a true perspective bitmap distortion! Which means that 2 triangles per cube face should give just as good quality as hundreds in Flash 9.

But that's going to be a while, since Flash 10 is not yet out of beta, and it will still have to build up to a wide installed base before it will be a good platform for a panorama viewer.

Zephyr

Papervision 3D

I then don't understand:/ Why developers proudly put suffix '3D'... if in total this simply simulation this notions and is not a native 3D engine (with support GPU polygonal render and etc.)

re: Papervision 3D

Well at this point in time Flash doesn't support GPU polygonal render etc. Maybe in Flash 10 it will be supported with the new gpu wmode, but it seems no one can really provide good information as to what will be graphics accelerated, and what not, and how different the final release player will be from the beta one. And according to at least one of Adobe's programmers the GPU acceleration will actually SLOW most operations, and may make content that requires a supported GPU unuseable on other machines (BAD). And finally, the great attraction of Flash is the enormous installed base of plugins. Java doesn't have that. Shockwave doesn't have it. It is as close as you get to 100% of browsers being able to view your panoramas and tours.

So why is Papervision 3D called 3D? because it can generate a 3D rendering that is subjectively perfect, albeit at a performance cost.

You can make the same argument about Calculus: why do "they" say you can find the area under a curve if the area is delimited not by a curve, but by straight lines, except in the impossible, infinite case. But nobody makes that argument since Calculus works for what we need and has worked for what we need for years.

Zephyr

Flash 3D

I do not consider Papervision 3D as revolution...

See real 3D development in Flash...

Flash 9
http://blog.alternativaplatform.com/ru/files/2008/04/bunker.swf

Flash 10 (* if faster comp's)
http://blog.alternativaplatform.com/ru/files/2008/04/bunker_fp10.swf

In this really possible to go into 3D space (like as 3D shooter Doom, Quake etc.)

How to use:

It's not accustomed and loved control panoview (like as 3D shooter)... You may go in space, pass in door, step at other room, left, right, onward, backwards etc.

Possible you will wonder...

This is a first step in unexplored Native Flash 3D

Why "3D" when it's really not?

Hey hum@noid:

Similar to what Zephyr said, but much shorter: Convention.

That is, it's what people say. You could make a similar argument for "VR Photography"... Which is not really "Virtual Reality" (VR) in the pure sense of the term. Also, "Nodal Point" is not quite correct either ("point of no parallax" is closer). But, these are terms that are in the vernacular.

Smile

Three cheers for VR, Nodal Points and 3D!

[ edit ]

hum@noid: I don't think anyone's trying to say that PaperVision (or Away3D or others) are "real" 3D... Is that the point you're trying to make? I'm not sure I understand, especially since you're so active in the VR Photography and Flash VR world...

Cheers,

Patrick

Yes- yes - it's Convention

If you have noticed (via links on forum) my pro.works it's virtual 3D (computer graphics) inrterior design... animation and composing for ads. broadcasting

I'm not enthusiastic - VR photographer... VR photography (for me) only to use spherical textures for 3D scene environment... Secondary VR panoramic production it's offer a some clients...

I'm not newbee or NUB for realization of some things

So.... for me '3D' concept... this ingrained understanding of this term... so question was given...

It is VR panorama? - http://vr.mmgfx.com/empirecompany/

Remaining portion - Zephyr says or clearview as God day - it's triangles:)

ps. Maybe:)
'Virtual reality' - this a reality via sensor and composing to global interactive projection virtualy...
'Nodal Point' - this watcher look point from virtual environment...
'No paparallax point' - this ideal equipment settings for VR shoots...
as you think:))))?

sorry for my poor eng.

Papervision and Alternativa

Hi hum:

I finally am understanding what you are saying. You are pointing out that a pano viewer presents a scene from one point, and you would like to be able to travel through the scene. I couldn't agree with you more, that is great.

Incidentally, Papervision and Alternativa are fundamentally very similar, everything is basically bitmapfilled triangles. (alternativa is closed source, so we don't really know the details), but you can do create exactly the same sorts of complex shapes (rooms) in Papervision and move around in them, and if you duplicated exactly the same shape and images in both, I would not be surprised to discover that they are nearly indistinguishable.

And I have intentionally preserved that aspect of Papervision in PanoSalado, although it is not being used at all now, but I have been playing around with the idea of putting true three dimensional objects in the space that the camera could move around.

Personally I am more interested in the photographic capturing and re-displaying of a panorama, so it doesn't bug me that a 3D engine is being used for a trompe l'oeil. And right now technology even in fancy games on devoted hardware is not close to being able to handle photo-realism. The number of polygons and the detail in the texturing, and the time in creating the model would be immense...

Zephyr

Impressive

Works great. All the paying flash pano solutions will have a strong contender now.

Tnx

Maurice

where can I find the src of this project

I'm a flash developer working on a budget custom panorama viewer. I'd love to port the open source AS3 mxml of PanoSalado, but I can't seem to find complete source on this site. Could somebody post a link?

found it and posting it for prosperity

Link to Panosalado downloads

Hi gibbitz:

Glad you found it, and glad you're interested! Smile

For the record, all links to PanoSalado examples and downloads are in the latest blog post for PanoSalado:

http://flashpanos.com/blog/79

Also, PanoSalado needs to be ported to Flex/mxml and not the other way around. Wink

Cheers,

Patrick