# Cubemap adapter

Cube mapping (opens new window) is a kind of projection where the environment is mapped to the six faces of a cube around the viewer.

This adapter is available in the core photo-sphere-viewer package in dist/adapters/cubemap.js.

Photo Sphere Viewer supports cubemaps as six distinct image files. The files can be provided as an object or an array. All features of Photo Sphere Viewer are fully supported when using cubemaps but the fisheye option gives funky results.

new PhotoSphereViewer.Viewer({
  adapter: PhotoSphereViewer.CubemapAdapter,
  panorama: {
    left:   'path/to/left.jpg',
    front:  'path/to/front.jpg',
    right:  'path/to/right.jpg',
    back:   'path/to/back.jpg',
    top:    'path/to/top.jpg',
    bottom: 'path/to/bottom.jpg',
  },
});

WARNING

This adapter does not use panoData option. You can use sphereCorrection if the tilt/roll/pan needs to be corrected.

# Example

# Panorama options

When using this adapter the panorama option and the setPanorama() method accept an array or an object of six URLs.

// Cubemap as array (order is important) :
panorama: [
  'path/to/left.jpg',
  'path/to/front.jpg',
  'path/to/right.jpg',
  'path/to/back.jpg',
  'path/to/top.jpg',
  'path/to/bottom.jpg',
]

// Cubemap as object :
panorama: {
  left:   'path/to/left.jpg',
  front:  'path/to/front.jpg',
  right:  'path/to/right.jpg',
  back:   'path/to/back.jpg',
  top:    'path/to/top.jpg',
  bottom: 'path/to/bottom.jpg',
}