Narrow zoom-in on startup (no black zones or attempted rectilinear distortion) and better support of webvr - help wanted

  • Well, I upgraded after a while as I want to get support of multi-res cylinders back (it used to be present in flash, but now is an extra fee feature for html5) and to support WebVR.

    It's mostly working for pano display, but I have a variety of issues I would like some help on if possible:

    1. When the pano begins, it is zoomed out just a little further than it used to, so that we see a black semicircle top and bottom due to the projection of the cylinder. I don't like it, so I want to zoom in just enough to make the projection in the center match the height of the window, with no black region unless they zoom out. What's the best way to do that, to match the old behaviour? Or what if I just don't want this distortion at all, since a cylindrical pano already has it?
    2. Any way to give the pano frame focus, so people can immediately start moving around with arrow keys? At present, they have to click inside the frame first, and then they can use arrow keys. Zoom wheel can be used without clicking.
    3. Previously, you could also move and zoom with other keys. Now there seem to be no keys for zooming, only the wheel. There was, in flash a little graphical navigation pad, which would be nice to see.
    4. I am having problems getting webvr to work. When I try the examples on krpano site, they (mostly) work on the Oculus Quest. When I try the same examples on my own test site they refuse to enter into VR mode. When you click to go into VR mode it just makes the viewscreen larger but you still just have to drag the pano around that window. My test sever is not https, is this a factor?
    5. Strangely, after upgrading my licence and modifying the krpano.js to include the licence, when I got to the server with chrome, there is no watermark. When I go to it with Oculus, same URL, there is a demo watermark. Strange...
    6. In VR mode is there any way to go "back" without deliberately putting in a hotspot for it? The back button in the forest demo does nothing.
    7. I would like it if VR users could be able to go directly into VR viewing of a panorama upon going to the page. No multiple clicks each time. In particular, I would like to set up an easy tour so they pick the images from the web page, and as soon as they click on them, they seem them in VR. I might also add a hotspot for "next" and "previous" image which will take them to that, but keeping them in VR if possible. I have a thousand panoramas so the idea of "next" will be generated by a CGI script.
    8. Is there a good way, with very high resolution panoramas, to let people in VR zoom in to see detail? Of course this would mean they no longer had the full 360 view though I could imagine games which simulated being in the middle of a big sphere with the pano on the inside of the sphere, and you can move yourself up to the sphere to see more detail. Breaks the VR illusion of being in the space, but lets you see the detail since VR resolution is poor.

    Any advice on how to get these things going is appreciated. VR most of all as it's Burning man virtual weekend and I want to get my giant panoramas up in VR.

    3 Mal editiert, zuletzt von bradtem (4. September 2020 um 10:46)

  • Adding a few notes about the behaviour I am looking for. The program that generates the XML can of course (and already has) distinguish between the different types of panos and generate the right XML for them:

    1. If the pano is of say 2.5:1 or narrower aspect ratio, display as flat partial pano, fit to frame (ie. black bars on top or sides.)
    2. If the pano is much wider FoV but not 360, display as flat partial pano, but start with fitting the height to the frame, scroll around to see full pano. No distortion of pano.
    3. If the pano is a 360 degree cylinder, display fit to height as in #2, but very importantly, connect ends to make a full 360 you can move around as much as you like. NO distortion of the image, however.
    4. If the pano is spherical but a strip, display to fit height, but distort to correctly display sphere onto screen frame as needed. If 360 should loop around.
    5. If full sphere, start with a suitable vfov, and display normally for a full sphere


    As noted I have code which reads the parameters from krpano (RIP) ".pano" files to learn the dimensions, FOV and projection type of the pano, and generate the XML appropriately. It used to work, I just need to know how to do it with the new releases as it is not working right now.

    When I upgraded to support html5 I had to give up all ability to do 360 degree loop around panos as it did not support those in multires at that time. Now it supports them, but I want to recapture the old behaviour I had in the flash version for the 360 view panos.

  • When the pano begins, it is zoomed out just a little further than it used to,


    In vtourskin.xml line 1123 is tofov="80". delete this line
    here:
    <!-- autotour/autoplay support -->
    <autorotate enabled="calc:skin_settings.autotour == true"
    waittime="5.0"
    accel="0.7"
    speed="4.0"
    tofov="80"
    />

  • BTW, here is what I mean by distorting on cylinder panos. See the attached screen shot of what it looks like if you zoom out of a cylinder now. A cylindrical pano which does not have the region around zenith and nadir, has been pre-calculated for flat projection. Of course, if you do a "flat" pano it doesn't do this but flat panos don't wrap around when 360 as they should, unless that changed.

  • Well, I dropped a simple pano on the vtour with webvr droplet. It makes it and the local server (switched to windows) But the same result with Oculus quest when you click the "enter vr" button. It does not expand to VR, it just makes the view box a bit bigger.

    Clearly it is possible to make it work since the examples on krpano.com mostly work -- but how?

    Here is an image of what it looks like in the Oculus Quest when I go into a pano created by the vrtour (VR-Opt) droplet. Served by the bundled tiny web server. I would love to be able to get a few VR panos working this weekend, but if even the official simple droplet won't make one, it is not clear which direction to go...

  • Yeah, I pieced that out with some other searches last night. Sigh. Would be real nice if tools gave a diagnostic instead of just failing invisibly. Don't run SSL on local web server for testing, so need to test the panos on a different server. Trying to generate XMLs that work with both 2 year old and current krpano to do that more easily.

  • Hi,

    When the pano begins, it is zoomed out just a little further than it used to, so that we see a black semicircle top and bottom due to the projection of the cylinder. I don't like it, so I want to zoom in just enough to make the projection in the center match the height of the window, with no black region unless they zoom out. What's the best way to do that, to match the old behaviour? Or what if I just don't want this distortion at all, since a cylindrical pano already has it?

    Set view.fisheye to 0.0!
    Distorted views and viewing-range-limited partials pano-views don't work together.


    Any way to give the pano frame focus, so people can immediately start moving around with arrow keys? At present, they have to click inside the frame first, and then they can use arrow keys. Zoom wheel can be used without clicking.

    Set the focus setting the in the html file to true:
    https://krpano.com/docu/html/#focus
    When not set, the focus will be only set automatically when the pano is embedded as 'full-page' element.


    Previously, you could also move and zoom with other keys. Now there seem to be no keys for zooming, only the wheel. There was, in flash a little graphical navigation pad, which would be nice to see.

    Right, by default and in the default skins there are no keys for zooming be used.

    Please see here for setting custom keys for zooming:
    https://krpano.com/docu/xml/#control.keycodesin


    I am having problems getting webvr to work. When I try the examples on krpano site, they (mostly) work on the Oculus Quest. When I try the same examples on my own test site they refuse to enter into VR mode. When you click to go into VR mode it just makes the viewscreen larger but you still just have to drag the pano around that window. My test sever is not https, is this a factor?

    Yes, HTTPS is unfortunately a core requirement for VR or gyro from many newer browser versions.

    For enabling HTTPS in the krpano testing server please have a look here:
    https://krpano.com/docu/tools/testingserver/#https


    Strangely, after upgrading my licence and modifying the krpano.js to include the licence, when I got to the server with chrome, there is no watermark. When I go to it with Oculus, same URL, there is a demo watermark. Strange...

    Clear the browser cache.


    In VR mode is there any way to go "back" without deliberately putting in a hotspot for it? The back button in the forest demo does nothing.

    On every VR system there is a back for exiting the VR mode, on the Oculus Quest it's the 'hamburger' button on the left controller.


    I would like it if VR users could be able to go directly into VR viewing of a panorama upon going to the page. No multiple clicks each time. In particular, I would like to set up an easy tour so they pick the images from the web page, and as soon as they click on them, they seem them in VR. I might also add a hotspot for "next" and "previous" image which will take them to that, but keeping them in VR if possible. I have a thousand panoramas so the idea of "next" will be generated by a CGI script.

    That's not allowed by the browser, there need to be a manual user interaction for entering VR mode.


    Is there a good way, with very high resolution panoramas, to let people in VR zoom in to see detail? Of course this would mean they no longer had the full 360 view though I could imagine games which simulated being in the middle of a big sphere with the pano on the inside of the sphere, and you can move yourself up to the sphere to see more detail. Breaks the VR illusion of being in the space, but lets you see the detail since VR resolution is poor.

    Here a possibility for zooming in VR:
    https://krpano.com/forum/wbb/inde…72929#post72929
    But that currently works only when using the WebVR API, not in the WebXR API. With krpano 1.20.8, which will be released soon, then the zooming will also work when using the WebXR API.

    Best regards,
    Klaus

  • Yeah, I pieced that out with some other searches last night. Sigh. Would be real nice if tools gave a diagnostic instead of just failing invisibly.


    There is a warning in the krpano log when using HTTP and using the webvr or gyro plugins.
    If the browser itself allows VR on HTTP is not known until trying to enter the VR and then the reason for failing is not reported back by the browser.
    So a big error popup in this case might be more problematic...

    But the krpano webvr plugin provides several APIs for handling error cases, or specifying the behavior for certain devices and cases.

    Best regards,
    Klaus

  • Thanks for the help -- I look forward to people being able to zoom. Time is short this weekend so I will adapt it later.
    Ah, those old fisheyes had been necessary in older versions (flash) for some reason. I will purge them.
    When I read about the Oculus Quest, it called that button the button to abort the task you were in, not so much a back button. While it worked and I was using it, I did not realize it was the official way to go back.

    I have not used hotspots before so I will have to learn how to make one and do a tour, but I don't think I'll pull that off today while virtual burning man is going on.

    I did put focus:"true" in my call to embedpano a few days ago:
    embedpano({swf:"/krp/krpano.swf", focus:"true", target:"krpanoDIV", html5:"a
    uto", xml:"$krpxml"});

    But it does not seem to give the keyboard focus.

    One last issue. As noted, when the switch came to hml5, krpano lost the ability to do multires in anything but flat panos. So I did some modifications back then to use flat cylinders on all my panos, and gave up the ability to do wrap around 360. Now that this is back, I'm a little confused at what the right settings should be. Attempting to use "flat" causes it to no longer understand my layers, which are coded in the old, multi-line way. It works with cylinder mode with hfov=1 as before, when I add the line:

    <view limitview="off" maxpixelzoom="1.5" fovmax="1.0" fov="1.0" fovtype="HFOV"/>

    To my master xml, and then my main xml contains:
    <krpano>

    <image type="cylinder" multires="yes" tilesize="1024"

    hfov='1'

    >

    <level tiledimagewidth='28039' tiledimageheight='14086'> <cylinder url='kt1-%v_%00u.jpg'
    /></level>

    <level tiledimagewidth='14019' tiledimageheight='7043'> <cylinder url='kt2-%v_%00u.jpg'
    /></level>

    <level tiledimagewidth='7009' tiledimageheight='3521'> <cylinder url='kt4-%v_%00u.jpg' /
    ></level>

    <level tiledimagewidth='3504' tiledimageheight='1760'> <cylinder url='kt8-%v_%00u.jpg' /
    ></level>

    </image>

    Now, for a pano like this one: https://pic.templetons.com/cgi-bin/imget?…00.jpg&fw=28039

    I find that it works fine in Chrome and does what I want -- starts with the flat pano to fit the window, lets the user zoom in. However, in the Oculus Quest, the pano appears as a very tiny box you can barely see. How should I tweak the values to display right in both? Eventually I will need to rebuild these panos with the proper field of view information in them pulled out of the AutoPanoGiga .pano file (I built a tool to build krpano xml from the .pano file) but I don't have time to rebuild them all right now. A quick fix would get me going.

    Thanks again.

  • I did put focus:"true" in my call to embedpano a few days ago:
    embedpano({swf:"/krp/krpano.swf", focus:"true", target:"krpanoDIV", html5:"a
    uto", xml:"$krpxml"});


    The value for focus need to be a Boolean, not a String.
    Try it this way (without string quotes):

    Code
    embedpano({..., focus:true, ...});

    About your cylinder pano - either replace the hfov=1 from the <image> with the real horiztonal fov the image covers and remove the fov/fovmax from the <view>.

    Or if you want to keep the flat view in normal viewing mode, change all 'cylinder' texts to 'flat'. Flat panos will be automatically shown enlarged in VR.

    Or alternatively you can anytime change the image.hfov value at runtime, even with an animation.
    Please see this example for better understanding - first turn off there the viewing range limitation by clicking on the 'limitview' button in the right-top corner until it is 'off' and then play with the hfov/vfov sliders:
    https://krpano.com/examples/#partialpano

    Best regards,
    Klaus

  • Thanks. As noted, the reason for my troubles is that I built these many hundreds of panos years ago and now things have changed. I stuck in all the fov=1 2 years ago when HTML5 with no multires for non-flat came out, and of course now need to put in the real hfov again, which is known for the autopano built panoramas but not the older ones built with other tools in some cases. So it's a larger project than I had time for.

    My big issue was I get strange situations where it works fine in the browser but fails in VR, or vice versa. I got flat working finally in VR and it looks OK, but is, not too surprisingly, flat!

    Still working to understand the best combinations of hfov, fovmax to get the right display in VR and in browser, and to get rebuilding of the xml with the new makepano functionality going. Bit of a slog, but I have shot thousands of panos and so need to find ways to automate all I do.

  • Still no answer or solution to the question of how to not have rectilinear projection in a 360 degree cylinder pano. As noted, when you zoom out from those it becomes an undesireable bowtie shape with high distortion. What I really want here is a way to do a flat pano that wraps around in 360 and also wraps around in VR (even when not 360) but I have not found a way to do that.

    Unless I learn about that, the other option would be to be able to manually switch to "flat" from "cylinder" when zooming out for wide view.

    I have tried: set(image.type, "flat") and while it changes the value of the variable, it doesn't change the projection -- it's still a bowtie. The tiles are the same for either one.

    The final ugly solution I have considered is to create a scene where I had duplicate them <image> tag with a "flat" type, and switch scenes. Would prefer something a bit better if anybody can think of it. Maybe someday krpano will work as it did in flash days, and offer a cyclinder without distortions that wraps around?

  • Hi,

    changing the projection from flat to cylinder or inverse for VR is only possible by using the different scenes/panos.
    Or you use a cylinder with hfov=1 for normal viewing and change the hfov to a much larger value when in VR, that's dynamically possible.

    Btw - warping around flat-panos were never be supported, not in Flash and in HTMl5.

    Best regards,
    Klaus

  • Thanks. Wrote up some code last night to rewrite the xml files for the tiles to generate a sub-scene,which I can switch to. (Obviously nicer if one can do a switch in the xml, but an alternative that is more flexible would be a way to take an existing scene and somehow edit it's xml and then re-load it through a variant of loadxml or loadscene. (Ie. I take an xml tree as an object, edit it by changing or adding nodes in it, and then ask it to re-load the change so it reinterprets a change like image.type = flat or any other change that can't be processed except with a re-load.) It takes a great deal of time and effort to rebuild the image tags for many hundreds of multi-hundred megapixel panoramas that I always like it if I can just change the core XML libraries instead of the hundreds of pano-specific XMLs. (makepano with XML regeneration without re-building tiles would help there. I had that but lost it when I switched to your XML building from my own code.)

    Is there a way to trigger the switch to flat automatically if a user zooms out? At present I have a menu item I call "wide view" which will convert to the flat view (fully zoomed out) because I never want them to see that bowtie -- it is highly distorted. I'm a little baffled at why one would want a rectilinear warp with a very wide HFOV -- certainly not over 180 degrees, but I would venture not much over 90. I suppose it's a matter of taste, and the warp is minor at narrow fields of view, which is why to me I don't want the warp at any FOV -- but having wrap-around is very important for 360, and not using the flat projection in VR is also important, where it turns into a warp and cylinder does not. So consider it a feature request for support for 360 wrap-around in the flat projection.

    That said, what's the best way to set the vertical fov to the size which a viewlimit of "auto" does. When you set to auto, it sets the vfov to match in the center, with no black zone visible. But then the user can't zoom out at all, which is no my preference. I do want them to zoom out slightly, even if some warp and black region starts appearing when you zoom out.

  • More notes. So first I put the flat image into its own scene, and that worked decently. Then I decided to make two scenes, the cylinder scene with autoload=true and the flat scene as before which does not.


    But now, in the autoloaded scene all sorts of variables are not available, even global ones like xml.url -- is the autoload of the first scene not doing a merge? Is there a way to get it to do so? I don't want to keep stuff between loadpanos so I don't want to put keep on everything, if I can even put keep on such things.

    Or is there a way to access the "null" (ie. initial) scene after doing a loadscene, ie. to the tags that were replaced in a loadscene() such as of course the <image> tag? If I go to the flat scene I want to be able to get back to the cylinder scene.

    BTW, is there a guide in one place on just how you use variables and elements and when you have to put get() around them and when you can just use them? I am finding surprising times when you need to wrap a get() when I would not think you would. Ditto for arrays and when you can just write them with square brackets and when you must use the functions. One issue I ran into is with an array which may or may not have elements. If it doesn't have any elements it's null, and you can't access any of the functions. What's the best way to test for that? I ended up using if( get(arrayname) == null, ... ) but that seems inelegant.

  • Giving up on trying to do scenes (since autoloaded scene seems to not do a merge, erasing much info) I was able to get some decent success with the approach of switching the panorama to hfov=1. Then setting the hfov in the <view> object to 1 as well (using fovtype of hfov)

    However, now the viewlimit gets mucked up (I have it set to fullrange) in that it remains set to the fullrange of the original image, not the new one, even after an updateobject.
    So for now I am manually setting hlookatmin and hlookatmax to -0.5 and +0.5 and I guess I can try to calculate the vertical min and max as well -- but it strikes me that an updateobject() call should reset these values if doing viewlimit=fullrange, perhaps?

    I will have to set all these back if the user goes into VR of course.

    A long term goal would be to let the user zoom out from the initial view, and if they zoom out far enough, switch them to this flat-ish view (giving up wrap around.) Does that require I trigger an event every time they zoom?

    Right now, I am switching to starting viewlimit=auto because that is the height I want (no black visible) at the start, but I would like them to be able to still zoom out. Is there a way to allow them to zoom out but start with this height? I find that if I set the vfov in the view equal to the vfov of the image, it is not the same as you get for viewlimit=auto, so what is the formula for the right vfov in the view to get that?

    My goal, in wide view mode is that you can zoom out to see black bars but only in one dimension. For 99% of panos, that means you can zoom out to the full width, seeing black bars top and bottom, but it should not let you zoom out to where you see black left and right, and it should not let you move the vertical view to move the letterboxed image up or down (as it does if I don't constrain the vlookat)

    viewlimit=auto seems to follow the rule of "show no black" and this is a rule of "show only one dimension of black, and keep centered"

    Also, another minor problem -- when I do this fov=1 trick, sometimes I see thin black lines appearing in the pano. They flicker as I zoom and eventually go away most of the time, but it's distracting. presumably it is between tiles.

    Einmal editiert, zuletzt von bradtem (29. September 2020 um 00:19)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!