Compare panos multiple scenes

  • Hi,

    Trying to update Compare Scenes exemple to be able to select which scene to load in left and right krpano layers.
    But when action called I have : FATAL ERROR: loadxml() - xml parsing failed!
    A clue ?
    Many thanks

  • Hi,

    If you use for each pano a layer type krpano, put them on top of each other, and use some alpha then you're ready to go. With a slider you could change the alpha of the different layers. Done it with 1.21 and it works great.
    Obviously you need to sync the 'layers'/view..

    Not sure if it is easier to start from that compare example, or from scratch. I prefer scratch.

    Tuur*thumbsup*

  • Hi,

    thanks Tuur!

    Right, just use multiple krpano layers and stack them with some alpha settings.

    Syncing is easier in version 1.22, there only the view.syncto() action need to be called:
    krpano.com - Documentation - XML Reference

    That means one viewer would be the main one that controls the view, and the others be synchronized to that one.

    For details please see the sources of these examples:
    krpano.com - Examples
    krpano.com - Examples

    Best regards,
    Klaus

  • Hi,

    It seems like a relatively simple way to do this.

    krpano - 4


    However, while the zoom function works with the buttons, it doesn't work with mouse scrolling.

    (The coordinates are linked in both cases.)


    Is something wrong?

  • However, while the zoom function works with the buttons, it doesn't work with mouse scrolling.

    The mouse wheel gets captured by the 'base' layer - and therefore the view gets only changed there.
    Its the same when using the mouse wheel over the other layers.

    But the pano-controlling itself is done below the 'base' layer on an empty pano and from there synced to the others.

    Solutions:
    - either set enabled=false for the base layer
    - or instead the base layer, define the pano directly without extra layer

    E.g.

    Code
    <include url="overlay0.xml" /> 
    	
    <layer name="overlay1" type="krpano" width="40%" height="40%" align="left" edge="leftbottom" x="10" y="20" onloaded="krpano.actions.loadpano('overlay1.xml');"	alpha="0.6"	 
    				 capture="false" onclick="toggle(alpha);" /> 
    
    <layer name="overlay2" type="krpano" width="40%" height="40%"  align="left" edge="lefttop" x="30" y="-20" onloaded="krpano.actions.loadpano('overlay2.xml');"	alpha="0.6"	 
    				 capture="false" onclick="toggle(alpha);" /> 
  • enabled="false"

    I put this on everything and it was solved. Thank you.

    Code
    				 <include url="overlay0.xml" enabled="false"/> 
    
    	
    			 <layer name="overlay1" type="krpano" width="40%" height="40%" align="left" edge="leftbottom" x="10" y="20" onloaded="krpano.actions.loadpano('overlay1.xml');"	alpha="0.6"	 
    				 capture="false" onclick="toggle(alpha);" enabled="false"/> 
    
    			 <layer name="overlay2" type="krpano" width="40%" height="40%"  align="left" edge="lefttop" x="30" y="-20" onloaded="krpano.actions.loadpano('overlay2.xml');"	alpha="0.6"	 
    				 capture="false" onclick="toggle(alpha);" enabled="false"/> 
  • 1) Is it possible to use a transparency channel for the overlapping panorama? For example, using png.

    Probably not... there is no explicit support for that yet.
    Maybe, when not using multi-resolution, because there the tiles are rendered/drawn on top of each other during loading and that doesn't work with transparency...

    2) Is it possible to change the blend mode of the panorama layer? For example, adding.

    Should be possible by using the CSS 'mix-blend-mode' setting:

    mix-blend-mode - CSS: Cascading Style Sheets | MDN
    The mix-blend-mode CSS property sets how an element's content should blend with the content of the element's parent and the element's background.
    developer.mozilla.org

    E.g.

    Code
    <layer ... cssstyle="mix-blend-mode:difference;" 
  • Hi,

    that's possible, but only with a specific setup:

    1. the main viewer need to have a transparent background, therefore in the embedpano() call the bgcolor setting need to be set to transparent:

    Code
    embedpano({..., bgcolor:"transparent"});

    2. then the main viewer will get no pano <image> and keeps empty, only the hotspots can be defined. The overlapping pano images need to be defined in separate krpano layers and need to have set parent="BGLAYER", e.g.

    Code
    <layer name="pano1" type="krpano" parent="BGLAYER" zorder="1" ... />
    <layer name="pano2" type="krpano" parent="BGLAYER" zorder="2" ... />

    This way the panos are drawn behind the hotspots, can optionally use CSS blend modes for mixing and the hotspots are above that and unaffected by any blending-modes.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!