实现VR视觉效果

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>PhotoSphereViewer - equirectangular demo</title>
 
  <link rel="stylesheet" href="https://my.weblf.cn/alone_page/360vr/css/photo-sphere-viewer.min.css">
 
  <style>
    html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      margin: 0;
      padding: 0;
    }
 
    #photosphere {
      width: 100%;
      height: 100%;
    }
 
    .psv-button.custom-button {
      font-size: 22px;
      line-height: 20px;
    }
 
    .demo-label {
      color: white;
      font-size: 20px;
      font-family: Helvetica, sans-serif;
      text-align: center;
      padding: 5px;
      border: 1px solid white;
      background: rgba(0,0,0,0.4);
    }
  </style>
</head>
<body>
 
<div id="photosphere"></div>
 

<script src="https://my.weblf.cn/alone_page/360vr/js/three.min.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/polyfill.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/uevent.min.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/doT.min.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/NoSleep.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/DeviceOrientationControls.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/StereoEffect.js"></script>
<script src="https://my.weblf.cn/alone_page/360vr/js/photo-sphere-viewer.js"></script>
 

<script type="text/template" id="pin-content">
  <h1>来自cfc的礼物</h1>
 
  <p><strong>欢迎来到成职院</strong></p>
  <pre><code>

</code></pre>
</script>
<svg id="patterns">
  <defs>
    <pattern id="dots" x="10" y="10" width="30" height="30" patternUnits="userSpaceOnUse">
      <circle cx="10" cy="10" r="10" style="stroke: none; fill: rgba(255,0,0,0.4)"/>
    </pattern>
    <pattern id="points" x="10" y="10" width="15" height="15" patternUnits="userSpaceOnUse">
      <circle cx="10" cy="10" r="0.8" style="stroke: none; fill: red"/>
    </pattern>
  </defs>
</svg>
 
<script>
  var panos = [
    {
      url: 'https://img.zcool.cn/community/01ahpjmphxigmiprjypgha3939.jpg?x-oss-process=image/format,webp/quality,q_100',
      desc: 'Bryce Canyon National Park <b>© Mark Doliner</b>',
      target: {
        longitude: 3.848,
        latitude: -0.244,
        zoom: 50
      }
    }, {
      url: 'https://i.ibb.co/p4hHp1s/222.jpg',
      desc: 'Bryce Canyon National Park <b>© Jess Beauchemin</b>',
      target: {
        longitude: 3.715,
        latitude: 0.574,
        zoom: 50
      }
    }
  ];
 
  var PSV = new PhotoSphereViewer({
    container: 'photosphere', 
    panorama: panos[0].url, 
    caption: panos[0].desc, 
    loading_img: '', 
    longitude_range: [-7 * Math.PI / 8, 7 * Math.PI / 8], 
    latitude_range: [-3 * Math.PI / 4, 3 * Math.PI / 4], 
    anim_speed: '-2rpm', 
    default_fov: 50, 
    fisheye: true, 
    move_speed: 1.1, 
    time_anim: false, 

    navbar: [ 
      'gyroscope'
    ],
   
    markers: (function() {
      var a = [];
      return a;
    }())
  });
  PSV.on('over-marker', function(marker) { //划过
    console.log('over', marker.id);
  });
 
  PSV.on('leave-marker', function(marker) { //离开
    console.log('leave', marker.id);
  });
 
  PSV.on('select-marker-list', function(marker) {
    console.log('select-list', marker.id);
  });
 
  PSV.on('goto-marker-done', function(marker) {
    console.log('goto-done', marker.id);
  });
</script>
 
<script>
  document.write('<script src="//' + location.host.split(':')[0] + ':35729/livereload.js" async defer><' + '/script>');
</script>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

-陈福城-

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值