Is it possible to change the base aspect ratio for the MFOV effective field of view calculation?

  • Hi Klaus,

    First I wanted to thank you for adding WebGL on iOS 8 support in the latest release. That was hugely beneficial on a project we're working on here.

    Now my question: I was digging into a use case here, and I noticed that the visible field of view doesn't always match the view.fov value for MFOV.

    Specifically, anytime the aspect ratio is less than 4:3, it seems to behave as if it's set to type VFOV, with a vertical field of view that is based on the complement to the defined view.fov at a 4:3 ratio. Also, since none of the screen, window, or viewer size is in a 4:3 aspect ratio, I believe it to be a value that is in the algorithm, as opposed to something environmental.

    Let me give a specific example to make things more clear.

    I open the FOV Types example in the KrPano examples directory (examples/xml-usage/fovtype/fovtype.html) and set the browser to 1:1, MFOV.

    Then, in the browser console, I type the following:

    Code
    # document.getElementById("krpanoSWFObject").get("area.width") / document.getElementById("krpanoSWFObject").get("area.height")
    1
    # document.getElementById("krpanoSWFObject").get("view.fov")
    90
    # document.getElementById("krpanoSWFObject").get("view.vfov")
    73.73979529168803
    # document.getElementById("krpanoSWFObject").get("view.hfov")
    73.73979529168803

    I noticed that neither view.hfov nor view.vfov has the same value as view.fov. Interestingly, when I changed the aspect ratio to 4:3, things began to make sense:

    Code
    # document.getElementById("krpanoSWFObject").get("area.width") / document.getElementById("krpanoSWFObject").get("area.height")
    1.3333333333333333
    # document.getElementById("krpanoSWFObject").get("view.fov")
    90
    # document.getElementById("krpanoSWFObject").get("view.vfov")
    73.73979529168803
    # document.getElementById("krpanoSWFObject").get("view.hfov")
    89.97048891153932

    Here I realized that the view.vfov value is exactly the same as it was in the 1:1 example. I played with this a bit, and this seems to be true of all aspect ratios less than 4:3, including those less than 1:1.

    My theory is that there's an underlying ratio in the field of view calculation when the fovtype is set to MFOV, and that the ratio appears to be 4:3.

    To be clear, I think in 99.99% of cases, the behavior is improved by having that ratio present, but for a particular project I'm working on, I'd like to be able to adjust it slightly.

    My question is, assuming my theory is correct, is there a way to override that value, or is it hard coded?

    Thanks!

Jetzt mitmachen!

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