mpetroff / pannellum

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

Support for non-Spherical panorama? #447

Closed edent closed 7 years ago

edent commented 7 years ago

Is it possible to display regular 360 panoramas?

I've an image like this:

640

It displays, but the perspective is skewed incorrectly.

(I'm assuming the answer is no - but wanted to check before giving up hope)

mpetroff commented 7 years ago

That really depends what you mean by "regular" panoramas. If the image has an equirectangular projection, it can be displayed even if it isn't fully spherical (other projections, e.g. cylindrical, aren't supported). See the partial panorama example. Use the haov, vaov, and vOffset parameters to set the proper limits. Alternatively, if Photo Sphere XMP metadata is present, it will automatically be used. The minYaw, maxYaw, minPitch, and maxPitch parameters can be used to restrict the viewer's movement extents. There's also a backgroundColor parameter for setting the color where there isn't image data (defaults to black).

edent commented 7 years ago

Aha! That works perfectly :-)

Thank you.