I want to use an equirectangular image with Panolens and achieve the same panorama viewer effect as seen in the links below:
Even though Panolens.js is based on Three.js, I encounter a different result when I input my image compared to the first link above. Instead of the camera focusing on the center of the image, it points towards the leftmost area.
To address this issue, I used the following code snippet:
panorama.addEventListener( 'enter-fade-start', function() {
viewer.getControl().target.set(10, -2, 0);
viewer.getControl().update();
//viewer.tweenControlCenter( new THREE.Vector3(2, -1, 1), 2000 );
});
However, upon moving to another panorama and returning, this code no longer has any effect (even though the event is triggered correctly).
How can I ensure that the camera consistently faces the same direction each time I switch back to my panorama? (I'm navigating between multiple panoramas).
It seems like I am struggling to grasp vectors properly and determine where 0,0,0 is relative to the current camera position in the panorama, leading to varying results based on the camera's orientation.
Any suggestions, resources, or explanations would be greatly appreciated.