three.js - 如何在 PANOLENS 中限制网格对象的旋转
问题描述
我正在开发一个全景编辑器,它可以对象不同纹理的网格对象,如图像、视频、图标等。为了控制我正在使用的对象属性,如位置、比例、旋转dat.gui
。
我想要实现的是设置旋转比例的动态限制,这样我的网格对象就不会从我的相机视图中消失panolens
。
GuiFolder.add(this.controller, 'rotationY', -89, 180).onChange( () =>{
mesh.rotation.y = this.de2ra(this.controller.rotationY);
});
这个特殊的硬编码值导致我的对象从视图中消失
这就是我的观点
this.panorama = new PANOLENS.ImagePanorama('https://pchen66.github.io/Panolens/examples/asset/textures/equirectangular/tunnel.jpg');
this.viewer = new PANOLENS.Viewer({ container: this.container.nativeElement });
this.viewer.add(this.panorama);
所以这又是一个 360 度查看器,所以我想根据我的位置限制我的网格对象旋转viewer.camera
轴