Posts by jmulder
-
-
-
We're using kmakemultires (part of release 1.0.8.11) to automatically convert uploaded images from our customers to a multi-resolution set. Depending on the dimensions of the input image we assume a certain output. It has always been to my understanding that with an exact width/height ratio of 2:1 that we can safely assume images for cubical projection can and will be outputted. If it's anything above 2:1 (say 3:1) than we have to assume we're dealing with a partial (vertical wise) panorama and output images for spherical projection.
However, in our testing we see this logic is not completely followed by kmakemultires. It almost seems as if kmakemultires has a margin of error in determining for how long it will still try to output cubical images.
We assumed:
- 2000x1000 (2:1) --> cubical
- 2001x1000 (>2:1) --> spherical
- 3000x1000 (>2:1) --> sphericalHowever, the following seems true:
- 2000x1000 --> cubical
- 3768x1880 (>2:1) --> cubical (real world example)We have not yet determined the boundary, as I'm kind of hoping someone can share the algorithm so we can explain it to our customers and make adjustments accordingly.
-
michel, thanks for the quick reply, but I just solved it in 10 seconds.
Very embarassed to admit it was caused by a cached version of the input image. Google Chrome caches anything loaded through Flash ruthless and never seemed to pick up on the changed JPG. Moving on.
Edit: This does make me realize we'll have to seriously look at implementing proper expiration headers for the input images as well. Already doing this with the XML though.
-
It has always been to my understanding --and some of my old prototypes seem to show this behaviour as well-- that Krpano is perfectly capable of determing view settings itself. In particular the properties 'fov', 'fovmax', 'vlookatmax' and 'vlookatmin'.
My input image is a simple JPG of 1837x313 px. In those old prototypes Krpano is perfectly capable of initializing and limiting the view in such a way that one cannot look beyond the top or bottom edges of the image.
Unfortunately, now I cannot for the life of me get it to work anymore. Here's me hoping some of the Krpano veterans can shed some light on the possible causes. We're using version 1.0.8.11 in both the implementation and the prototypes.
The used XML is the following:
XML
Display More<?xml version="1.0" encoding="UTF-8" ?> <krpano version="1.0.8"> <!-- Include Global Settings --> <include url="/js/pano/global.xml" /> <!-- Include Editor Settings --> <include url="/js/pano/editor.xml" /> <!-- View Settings --> <view hlookat="28" vlookat="0" /> <!-- Image Settings --> <image type="sphere"> <sphere url="/_temp/360fotos/panoramas/temp/pano.jpg" /> </image> <!-- Hotspots --> <hotspot name="hotspot-1" style="hotspot" ath="199" atv="5" title="Keuken" href="080C5BC6-F95B-4D23-87D9-9A50227D0806" /> </krpano>
Even when using the following barebones version it won't work. As such, I can't believe it's caused by anything in the global.xml or editor.xml files.
XML<?xml version="1.0" encoding="UTF-8" ?> <krpano version="1.0.8"> <!-- Image Settings --> <image type="sphere"> <sphere url="/_temp/360fotos/panoramas/temp/pano.jpg" /> </image> </krpano>
The documentation as well as my prototype leads me to believe this should work. The default settings of view.hfov equals 360 which is correct for the input image. Since view.vfov is empty, this should be calculated based on the view.hfov and the input image's dimensions. Finally, automatic limiting for vlookatmin and vlookatmax should kick in.
I tried a lot of settings related to limitrange and whatnot, but to no avail. If anyone could give some ideas what could possibly cause Krpano not to figure it out on its own, it'd be much appreciated. I am completely clueless right now.
Unfortunately, I cannot provide much more code as we have a lot of code doing lots of things, nor can I give an online location as it is not released yet.
Thanks in advance.
-
This is the basic template I use and holds all the required event bindings and such:
- registerEvent() is the one that's called when your plugin is registered and ready for use in the Krpano viewer. From this point on the global variable 'p' holds a reference to the plugin instance. Through this you can read or write its data.
- updateEvent() called whenever the data changes (either through your own Flash plugin or through an action in the XML)
- resizeEvent() called when the size changes
Code
Display Morepackage { import flash.display.MovieClip; import flash.events.DataEvent; import flash.events.Event; // Import Krpano interface import krpano_as3_interface; public class Main extends MovieClip { // // Properties // // Krpano interface public var krpano:krpano_as3_interface = null; // Krpano plugin instance private var p:Object = null; // // Instantiate // public function Main () { if (stage === null) { addEventListener(Event.ADDED_TO_STAGE, startPlugin); addEventListener(Event.UNLOAD, stopPlugin); } } // // Start plugin // public function startPlugin (e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, startPlugin); // Get Krpano instance krpano = krpano_as3_interface.getInstance(); // Register plugin listener krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, registerEvent); krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_RESIZE, resizeEvent); krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_UPDATE, updateEvent); } // // Stop plugin // public function stopPlugin (e:Event):void { krpano.removePluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, registerEvent); krpano.removePluginEventListener(this, krpano_as3_interface.PLUGINEVENT_RESIZE, resizeEvent); krpano.removePluginEventListener(this, krpano_as3_interface.PLUGINEVENT_UPDATE, updateEvent); } // // Register plugin // public function registerEvent (e:DataEvent):void { // Get plugin data p = krpano.get(e.data); } // // Resize plugin // public function resizeEvent (e:DataEvent):void { } // // Update plugin // public function updateEvent (e:DataEvent):void { } } }
-
I'm not exactly sure what you're trying to accomplish with your code examples, but you can read/write plugin attributes just fine using the standard interface.
If you look at: http://www.krpano.com/docu/plugins/#register
You'll see a standard method to get a reference to the plugin's instance.
Code
Display More... // Register plugin listener krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_REGISTER, registerEvent); public function registerEvent (e:DataEvent):void { // Get plugin data p = krpano.get(e.data); // Change properties p.url = 'foo'; p.ahv = 120; p.atv = 15; } ...
-
I'd presume Krpano uses device fonts. As such, on your machine, any font installed there is usable in Krpano as well. However, any non-system fonts may not be available on someone else's system.
Unless you have complete control over the installed fonts on the machine that views the Krpano viewer, I would recommend sticking to system fonts only similar to the font restrictions in regular websites. That or find a way to embed your non-system font in a Flash file and use it like that, but that's a completely different scenario.
-
If all you need to know is when it's done, I think this should work.
Codefunction registerEvent (e:DataEvent):void { krpano.set('events.onloadcomplete', onLoadComplete); } function onLoadComplete ():void { // ... }
I wouldn't know the required arguments for the method, but I'm guessing no arguments.
-
Just a small update for future reference, I managed to more or less solve the problem but only specifically for my case. In my situation I needed a plugin overlaying the complete viewer, but the only interactive part was positioned as a small button in the top right corner.
Note: This is just a big workaround and does not actually solve the problem related to mouse event bubbling.
The implemented workaround is as follows:
plugin[fsborder] with enabled=false, capture=false
This effectively just makes it decorative and allows all other hotspots to work just fine as if nothing else is there. The plugin itself uses the resizeEvent to calculate the dimensions and resizes the plugin accordingly. This plugin has all the Actionscript for the hover and click functionalityplugin[fsbutton]
The aforementioned plugin dynamically adds this plugin, so we can store a reference to the event handlers in the plugin's properties:Code
Display More// // Register plugin // function registerEvent (e:DataEvent):void { // Get plugin data p = krpano.get(e.data); // Add transparant plugin as a proxy krpano.call('addplugin(fsbutton)'); krpano.call('plugin[fsbutton].loadstyle(control)'); krpano.set('plugin[fsbutton].keep', 'true'); krpano.set('plugin[fsbutton].height', '26'); krpano.set('plugin[fsbutton].width', '26'); krpano.set('plugin[fsbutton].align', 'righttop'); krpano.set('plugin[fsbutton].x', '0'); krpano.set('plugin[fsbutton].y', '0'); // Proxy events krpano.set('plugin[fsbutton].onover', onRollOverEvent); krpano.set('plugin[fsbutton].onout', onRollOutEvent); krpano.set('plugin[fsbutton].onclick', onClickEvent); }
Edit: The methods onRollOverEvent and such are within the same Flash plugin. Their signature require to expect no arguments, unlike conventional event handlers assigned through Actionscript itself.
Truly love how internally it all are just variables and all plugins can reference eachother through Krpano.
Hiding/showing the plugin using Javascript
Finally, the Javascript applies a simple hover behaviour on the SWF element, which calls the Krpano interface and tells it to hide or show the plugin. -
I'm one of the UX designers (and responsible for part of our front-end development) at a large Dutch website (350.000 daily uniques, 11 million daily page views) and our statistics show that Flash 9 is used by 3.2% of our visitors over the past month (4.6% in the past 6 months). In our back office system exclusively used by users in a small to medium business environment (users who often do not have the system privileges to upgrade their own software) the figures are 5.1% in the past month and 7.2% in the past 6.
I just wanted to show support for dropping Flash 9 compatibility, as I completely understand the benefits of dropping backwards-compatibility at certain key points in development of your product. Our aforementioned figures have been steadily declining and even though only a small percentage will still represent a large number, we'd be willing to go with it if the compatibility wasn't dropped in the next six months. I'm more or less confident the numbers will be neglible within the next six (or let's just say I really hope so :-)). As such, releasing 1.0.8 with Flash 9 compatibility would be our preference.
-
Searching the forum regarding the correct use of the 'enable' and 'capture' properties for plugins didn't give me much, so I decided to create a new thread. I seem to be having problems with using the aforementioned properties and having mouse events bubble through to any hotspots that are underneath it.
The documentation mentions:
Quote.. when "enabled=true" and "capture=false" then the mouse events are sent to the plugin and also to all underlying objects ...
From searching the forum Klaus mentioned that with "underlying objects" he meant hotspots and the krpano object itself. Taking this explanation I would have assumed the following works, but it doesn't seem to.
My situation is as follows (unfortunately I cannot provide working examples):
Plugin
I want to have an action executed whenever someone 'onmouseover' the entire Krpano viewer. To do this I created the following plugin:Code
Display More<plugin name="fsoverlay" url="/img/misc/bg-grey-100.png" align="lefttop" x="0" y="0" width="2000" height="2000" alpha="0" zorder="0" handcursor="false" capture="false" enabled="true" onover="fshover(true)" onout="fshover(false)" onhover="if(get(fullscreen), fshover(false))" />
Hotspots
Naturally I want hotspots in the viewer as well. As such, mouse events on the 'fshover' plugin needs to bubble through to all underlying objects. I would have assumed the above settings for the 'capture' and 'enabled' properties would work, but it does not.Any help would be greatly appreciated! If you need more (or just a better) explanation, then let me know.
-
Allow me to answer my own question for the people that are interested, I suppose I 'guessed' the correct syntax.
Code// Level 1 so.addVariable('image.level[0].tiledimagewidth', '10000'); so.addVariable('image.level[0].tiledimageheight', '5000'); so.addVariable('image.level[0].back.url', '/panorama/tiles/versaille_b_l0_%25y_%25x.jpg'); so.addVariable('image.level[0].down.url', '/panorama/tiles/versaille_d_l0_%25y_%25x.jpg'); so.addVariable('image.level[0].front.url', '/panorama/tiles/versaille_f_l0_%25y_%25x.jpg'); so.addVariable('image.level[0].left.url', '/panorama/tiles/versaille_l_l0_%25y_%25x.jpg'); so.addVariable('image.level[0].right.url', '/panorama/tiles/versaille_r_l0_%25y_%25x.jpg'); so.addVariable('image.level[0].up.url', '/panorama/tiles/versaille_u_l0_%25y_%25x.jpg');
Also looks like SWFObject 1.5 does not encode the values properly, so I had to urlencode the placeholders in the URLs myself. Still not working perfectly, but tiles are loading and the rest might have something to do with my tiling mechanism instead.
-
I just remember the syntax for plugins and tried to apply that.
Codeso.addVariable('image[level].tiledimagewidth', '10000'); so.addVariable('image[level].tiledimageheight', '5000'); so.addVariable('image[level].back.url', '/panorama/tiles/versaille_b_l0_%v_%u.jpg');
Got rid of the errors, but it's not working just yet. Would this be the correct syntax though?
-
Hi,
I can't seem to get multi-res cubical panoramas working when the viewer is initialized using Flash variables. The documentation uses the following XML as an example:
Code
Display More<image type="CUBE" multires="true" tilesize="512"> <level tiledimagewidth="1024" tiledimageheight="1024"> <left url="cube1024/left_%v_%u.jpg" /> <front url="cube1024/front_%v_%u.jpg" /> <right url="cube1024/right_%v_%u.jpg" /> <back url="cube1024/back_%v_%u.jpg" /> <up url="cube1024/up_%v_%u.jpg" /> <down url="cube1024/down_%v_%u.jpg" /> </level> <level tiledimagewidth="2048" tiledimageheight="2048"> <left url="cube2048/left_%v_%u.jpg" /> <front url="cube2048/front_%v_%u.jpg" /> <right url="cube2048/right_%v_%u.jpg" /> <back url="cube2048/back_%v_%u.jpg" /> <up url="cube2048/up_%v_%u.jpg" /> <down url="cube2048/down_%v_%u.jpg" /> </level> <level tiledimagewidth="4096" tiledimageheight="4096"> <left url="cube4096/left_%v_%u.jpg" /> <front url="cube4096/front_%v_%u.jpg" /> <right url="cube4096/right_%v_%u.jpg" /> <back url="cube4096/back_%v_%u.jpg" /> <up url="cube4096/up_%v_%u.jpg" /> <down url="cube4096/down_%v_%u.jpg" /> </level> </image>
I assumed I could translate this to the following Flash variables:
Code
Display More... // Multi-resolution so.addVariable('image.multires', 'true'); so.addVariable('image.tilesize', '500'); so.addVariable('image.baseindex', '0'); // Level 0 so.addVariable('image.level.tiledimagewidth', '10000'); so.addVariable('image.level.tiledimageheight', '5000'); so.addVariable('image.level.back.url', '/panorama/tiles/versaille_b_l0_%v_%u.jpg'); ...
Unfortunately, the viewer returns an "unknown attribute/path" for the 'tiledimagewidth' and 'tiledimageheight' properties, as well as 'unknown node/path' for the 'image.level.back.url' property (which I would guess is a result of the former error).
Any help would be greatly appreciated.
-
Hi jmulder,
I think you must be sure at 200% that the version of krpano.swf is 1.0.8.beta 9 instead of 1.0.7
Have you tried to clear the browser cache?
If you had already cleared the cache, try to open your krpano.swf directly into the browser and press the 'o' key to see what version it is... 1.0.7About the Flash variables...
I have tried to add these Flash variables:
Codeso.addVariable("view.fovmin", "30"); so.addVariable("view.fovmax", "150"); so.addVariable("view.fov", "70"); so.addVariable("view.maxpixelzoom", "1.0");
The result is that the view opens at FOVMAX value...FOV=150...
But the maxpixelzoom seems to work properly when zooming...
If I delete the view.maxpixelzoom variable, then the view opens at the correct FOV value... FOV=70...Perhaps there is some Bug issue here....
SAlut
Opening the krpano.swf directly did the trick, even after clearing the cache multiple times. Such a noob error -- nice. Move along now. Nothing to see here
I am getting unexpected results when adding maxpixelzoom as well. Strange.
-
Am I correct in saying that both view.fovtype and view.maxpixelzoom are not yet available to be used through Flash variables? I don't seem to be seeing a difference for view.fovtype and view.maxpixelzoom seems to be unrecognized/unknown, according to the player.
QuoteINFO: krpano 1.0.7
INFO: Flashplayer WIN 10,0,2,54 PlugIn (debug)
ERROR: unknown attriubate/path - view.maxpixelzoomWhich is odd considering the version number it reports. I am 100% sure it's loading the krpano.swf as supplied in the aforementioned ZIP package.
Relevant Flash variables set through SWFObject using:
Edit: Above example displays 'VFOV', but I didn't see any difference for the other values either