播放简单的圆柱投影
效果:
代码:
<!DOCTYPE HTML>
<html lang="ch">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author"content=“KaiSarH,huankai7@163.com”>
<title>A simple example</title>
<link rel="stylesheet" href="pannellum.css"/>
<script type="text/javascript" src="pannellum.js"></script>
<style>
/*
定义样式,全景图显示的位置
*/
#panorama {
width: 1200px;
height: 800px;
}
</style>
</head>
<body>
<div id="panorama"></div>
<script>
// 使用pannellum.viewer可以创建一个新的全景对象
// 第一个参数type设置Pannellum处理全景图片的方式
// 第二个参数panorama添加全景图片
pannellum.viewer('panorama', {
"type": "equirectangular",
"panorama": "test/test.jpg"
});
</script>
</body>
</html>
总结: