mistic100 / Photo-Sphere-Viewer

A JavaScript library to display 360° sphere panoramas.
https://photo-sphere-viewer.js.org
MIT License
1.94k stars 690 forks source link

Image Distortion #132

Closed IceBlueFire closed 7 years ago

IceBlueFire commented 7 years ago

I've tried a variety of panorama apps for the iPhone, but when i load them into the viewer, i get some image distortion that stretches the images in a weird way, however the images look fine while looking at them in the native apps. Is there a setting that i'm messing up somewhere that is messing with this?

Edit: Example link removed.

mistic100 commented 7 years ago

Are you referring to the the horizontal and vertical lines not being straight ? This is normal has how the sphere is drawn for performances.

Or the top and bottom being stretched ? It also occurs on desktop and this is because your panorama is not a sphere !

mistic100 commented 7 years ago

If you want to use partial projections (like rectilinear) you must define the corresponding area using XMP tags, see my answer here #78 (comment)

IceBlueFire commented 7 years ago

Yeah, i'm referring to the cars looking super compact when you look straight on at them, but then stretching back out as you continue to spin around. I'll take a look at that answer and give it a go, thanks!

One question regarding those numbers...How did you come up with them, specifically for the "full_width" and "full_height", as well as the "cropped" numbers?

mistic100 commented 7 years ago

The best way is to fit your image in a 2:1 image (this is the format of an equirectangular projection).

If your source is 3000x500 (a standard horizontal panorama)

      {
          full_width: 3000
          full_height: 3000/2 = 1500
          cropped_width: 3000,
          cropped_height: 500,
          cropped_x: 0,
          cropped_y: (1500-500)/2 = 500
      }