Hi,
I have a panorama with prealign values set (the image is rotated/leveled). When I click on the panorama and create a hotspot using mouse.x and mouse.y with prealign="true", the hotspot appears at the wrong position.
I understand that mouse.x/mouse.yreturns view-space coordinates, but a hotspot with prealign="true" expects image-space coordinates (before the prealign rotation).
Is there a built-in way to convert view-space spherical coordinates to pre-aligned image-space coordinates? Or what is the correct math/rotation order to do this manually?
I am doing something like that.
//for example krpano.prealign === "0|90|0"
const hs_new = krpano.actions.addhotspot();
let mx = krpano.mouse.x;
let my = krpano.mouse.y;
const {x,y} = krpano.actions.screentosphere(mx, my);
hs_new.ath = x;
hs_new.atv = y;
hs_new.prealign = true;
Display More
The hotspot appears offset from where I clicked. What is the correct approach?
removing prealign is not possible for my situatiuon. I am sending the coordinates to the backend and saving them. Users can add prealign (or rx/ry) of image dynamically, so I need to keep their original places.
Thanks!