我现在正在尝试为 panolens.js 设置初始查看器位置。
设置如下所示:
const panoPhoto1 = 'https://conceptcityiasi.ro/assets/images/tours/tip1/apartamente-noi-de-vanzare-iasi-dacia-1_camera-tip_1_360_living.jpg';
const panoPhoto2 = 'https://conceptcityiasi.ro/assets/images/tours/tip1/apartamente-noi-de-vanzare-iasi-dacia-1_camera-tip_1_360_hol.jpg';
const panoPhoto3 = 'https://conceptcityiasi.ro/assets/images/tours/tip1/apartamente-noi-de-vanzare-iasi-dacia-1_camera-tip_1_360_baie.jpg';
const panoPhoto4 = 'https://conceptcityiasi.ro/assets/images/tours/tip1/apartamente-noi-de-vanzare-iasi-dacia-1_camera-tip_1_360_bucatarie.jpg';
const panorama1 = new PANOLENS.ImagePanorama(panoPhoto1);
const panorama2 = new PANOLENS.ImagePanorama(panoPhoto2);
const panorama3 = new PANOLENS.ImagePanorama(panoPhoto3);
const panorama4 = new PANOLENS.ImagePanorama(panoPhoto4);
panorama1.link( panorama2, new THREE.Vector3( -900, -530, -4800 ) );
panorama2.link( panorama1, new THREE.Vector3( -490, -1200, -4800 ) );
panorama2.link( panorama3, new THREE.Vector3( -4700, -1030, 1100 ) );
panorama1.link( panorama4, new THREE.Vector3( -4100, -690, 2600 ) );
panorama3.link( panorama2, new THREE.Vector3( -1750, -870, -4500 ) );
panorama4.link( panorama1, new THREE.Vector3( -4100, -2400, 1300 ) );
const viewer = new PANOLENS.Viewer({
container: panoImage,
autoRotate: true,
autoRotateSpeed: 0.5,
autoHideInfospot: false,
clickTolerance: 100,
cameraFov: 100,
viewIndicator: true,
indicatorSize: 100,
output: 'console'
});
viewer.add(panorama1, panorama2, panorama3, panorama4);
我觉得我做错了什么,但我不知道是什么。我已经看到了一些带有 initialLookPosition() 的示例,但它们似乎都不起作用。