mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.15k stars 710 forks source link

Avoid MC Escher effect #1188

Closed erdmann040 closed 7 months ago

erdmann040 commented 7 months ago

Hi,

If I use the example for the multiresolution panorama on the desktop in a maximised browser window, everything works as desired, but if the height and width of the viewport differ greatly (as with most smartphones) and you then scroll back, you get a very distorted image that reminds me of the paintings by the Dutch artist MC Escher.

pannellum org_documentation_examples_multiresolution_(Samsung Galaxy S8+)

There must be a way to prevent this and let the stage look more natural, right?

Which configuration parameter lets me limit the scrolling back and can I perhaps set this parameter in relation to the viewport?

Thanks in advance for your help

mpetroff commented 7 months ago

There must be a way to prevent this and let the stage look more natural, right?

You can limit the maximum horizontal field of view with the maxHfov configuration parameter, or programmatically using the setHfovBounds API method. Panoramas are inherently a horizontal format, so the unnatural part is the absurdly tall aspect ratio (>2:1) you're showing.

erdmann040 commented 7 months ago

Thank you for your answer! You have helped me a lot.