google / marzipano

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

Cylindrical pano support #180

Open austinbiggs opened 6 years ago

austinbiggs commented 6 years ago

Has any had any success changing the geometry to support a Cylindrical pano? Originally I was under the impression that I needed to work with Equirectangular pano's, but after more research, I appear to be working w/ Cylindrical pano's.

Does anyone know if it's possible to modify Marzipano to work w/ cylindrical pano's?

tjgq commented 6 years ago

We don't support them currently. In theory you could implement a CylindricalGeometry class, which is basically a flat geometry that wraps around. RectilinearView shouldn't need any changes.

If you just want to display the panoramas, it's probably easier to use an existing tool to convert them into equirects or cubemaps.

tjgq commented 6 years ago

Actually, on second thought, a CylindricalGeometry class wouldn't be enough. You would also need a new WebGL renderer. If the entire cylinder fits in a single tile, it's a relatively straightforward modification to the existing WebGlEquirectRenderer. Supporting multiple tiles is harder.

We're not really planning to add support for cylinders. I'm just leaving this here in case someone else would like to work on it.

austinbiggs commented 6 years ago

@tjgq

How would I go about creating a CylindricalGeometry?

tjgq commented 6 years ago

A single-tile cylindrical geometry can probably be just a copy of EquirectGeometry. The corresponding renderer can be adapted from WebGlEquirectRenderer by replacing the coordinate conversions in the fragment shader from spherical into cylindrical coordinates.

Multi-tile is harder, because each rectangular subdivision of a cylinder doesn't map into a rectangular region in 3D space. It would have to be tessellated by the renderer. This is similar to what it would take to implement a multi-tile equirectangular geometry, which is also unsupported.