google / marzipano

A 360° media viewer for the modern web.
http://www.marzipano.net
Apache License 2.0
1.99k stars 995 forks source link

Sphere picture #379

Closed franciscop-sc closed 3 years ago

franciscop-sc commented 3 years ago

Hi I find Marzipano to be amazingly built! The reference image I see Marzipano uses in this example looks more like the one in the left. I'm trying to render an image like the one in the right, which is a sphere with the data. However I'm failing to do so. :

Official ExampleSpherical Image

Is there a way to use a "spheric" image instead of a stretched image? I've tried to change the parameters inside RectilinearView to no avail, is that even the right place to change parameters? Or is it more involved than just changing some parameters?

    // ...

    const source = Marzipano.ImageUrlSource.fromString("/images/cam1.jpg");

    // Create geometry.
    const geometry = new Marzipano.EquirectGeometry([{ width: 2880 }]);

    // Create view.
    const limiter = Marzipano.RectilinearView.limit.traditional(1080, (100 * Math.PI) / 180);
    const view = new Marzipano.RectilinearView({ /* ?? */ }, limiter);

    // ...
tjgq commented 3 years ago

It's not supported, sorry. My suggestion is to use an image processing tool to convert the panorama into cubemap or equirectangular format before using it with Marzipano.

Note: I'm assuming you're referring to input images in spherical format. If you have an input image in equirectangular/cube format, but want to display it as shown in the picture - a "little planet projection" - that's not supported either, but it's a different feature request :)

franciscop-sc commented 3 years ago

Thanks! I could make it work with https://github.com/legokichi/three-fisheye in the end (yes, I meant a spheric image as an input image).