如何发起Marzipano观众http://www.marzipano.net/

时间:2017-02-04 16:57:48

标签: virtual-reality 360-virtual-reality 360-panorama-viewer virtual-tour

由于Marzipano文档对新手不利,我不知道如何初始化全景

我决定只使用pano查看器并远离整合Marzipano工具!

到目前为止,我现在通过Marzipano工具生成360全景zip文件,并想在我的网站上呈现

怎么可能这样做?

http://www.marzipano.net/

1 个答案:

答案 0 :(得分:0)

这是您创建查看器的方式。

opts = { controls: { mouseViewMode: "drag" } }
const viewer = new Marzipano.Viewer(document.getElementById(domID), opts);

let defaultCubeGeometry = [{ tileSize: 256, size: 256, fallbackOnly: true }, { tileSize: 1024, size: 1024 }];
let cubeGeometry = new Marzipano.CubeGeometry(defaultCubeGeometry);

let limiter = return new Marzipano.util.compose(
  Marzipano.RectilinearView.limit.resolution(resolution),
  Marzipano.RectilinearView.limit.vfov(vfov.min, vfov.max),
  Marzipano.RectilinearView.limit.hfov(vfov.min, vfov.max),
  Marzipano.RectilinearView.limit.pitch(pitch.min, pitch.max)
);

let initialView = { yaw:0, pitch:0, roll:0 };
let view = new Marzipano.RectilinearView(initialView, limiter);
let source = new Marzipano.ImageUrlSource.fromString(imageUrl);
let scene = viewer.createScene({ source, geometry, view });
scene.switchTo();

这应该是查看器的完整初始化