I've been working on setting the initial viewer position for panolens.js for a while now.
Here's how the set-up looks:
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);
I'm struggling to figure out what I'm doing wrong. I've looked into examples using initialLookPosition(), but none of them seem to work.