Get current center coordinates
aferrato opened this issue · 4 comments
aferrato commented
Hello,
I would like to obtain the coordinates of the current center of the image to be able to use them later.
Let me explain, I move the panoramic image and I choose the view I prefer, how can I get the coordinates of the central point of the view?
Practically the same that can be done by pressing Ctr and moving the mouse, but referring to the center of panolens-container div.
thank you.
e-pacciani commented
This is the method i wrot to get the center coordinates
export function getCameraCenterPosition(viewer: Viewer): Position {
const position = viewer.raycaster.intersectObject(viewer.panorama, true)[0]
.point;
// intersectObject returns a negative x value so it must be set to the opposite to have the right x coordinate
position.x = -position.x;
return position;
}
CasperWind commented
hey @e-pacciani Where do i have to put your method?
i have tryed some things but i can only get the coordinates from the mouse not the center.
hungvo2010 commented
Have someone find out the solution? Please help me
hungvo2010 commented