【问题标题】:Image doesn't appear with THREE.js and Panolens.js图像不会出现在 THREE.js 和 Panolens.js 中
【发布时间】:2021-09-12 00:27:09
【问题描述】:

我正在尝试使用 THREE.js 和 Panolens.JS 获得带有一些信息按钮的 360 度环境

但我不知道为什么图片没有出现。

我不断收到错误:未捕获的 ReferenceError:未定义进程。

有人知道这个问题是从哪里来的吗?

  <body>
    <script src="https://cdn.jsdelivr.net/npm/three@0.122.0/build/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/panolens@0.12.1/build/panolens.min.js"></script>


    <style>html, body {
      width: 100%;
      height: 100%;
      overflow: hidden;
      margin: 0;
    }
    
   body {
  background-color: bisque;
    }
    
    #container {
      margin-left: auto;
      margin-right: auto;
      margin-top: 10px;
      width: 700px;
      height: 400px;
    }
    
  </style>
    <div id="container"></div>

    <script>

var panorama, viewer, container, infospot;
var containerBaseWidth = 700;
var containerBaseHeight = 400;
var deltaSize = 100;

container = document.querySelector( '#container' );

panorama = new PANOLENS.ImagePanorama( 'https://pannellum.org/images/alma.jpg' );

infospot = new PANOLENS.Infospot( 350, PANOLENS.DataImage.Info );
infospot.position.set( 0, 0, -5000 );
infospot.addHoverText( 'TEST PANOLENS', 30 );
panorama.add( infospot );

viewer = new PANOLENS.Viewer( { container: container } );
viewer.add( panorama );

function changeContainerSize ( width, height ) {
  viewer.container.style.width = width + "px";
  viewer.container.style.height = height + "px";
  viewer.onWindowResize( width, height );
}
    </script>

  </body>

【问题讨论】:

标签: javascript html css three.js


【解决方案1】:

我可以通过将 panolens.min.js 的原始代码直接保存在我的文件中而不是使用 url 链接来使其工作;)

【讨论】:

    【解决方案2】:

    panolens 的项目中有一个 github 问题记录了这一点:Uncaught ReferenceError: process is not defined

    昨天开业。

    https://github.com/pchen66/panolens.js/issues/340

    【讨论】:

    • 谢谢,我认为这不是问题,因为我正在使用 panolens.min.js,而且问题似乎是指向 panolens.js 的链接..
    • 我看到发帖人提到它不会在缩小版本中发生,但我测试了你的样本,它得到了同样的错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 2021-01-15
    • 2017-11-20
    • 1970-01-01
    • 2013-09-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多