【发布时间】: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>
【问题讨论】:
-
这是一个棘手的问题,看起来错误来自这里 github.com/pchen66/panolens.js/blob/… 我认为他们正在从节点服务器为项目提供服务,因此将定义流程
标签: javascript html css three.js